I want to navigate from welcome page to the login page, I created the 2 pages and now I want to navigate to the login page when I click on the Login button.
Here is the welcome page code:
import React from 'react';
import Button from '@material-ui/core/Button';
import Box from '@material-ui/core/Box'
const useStyles = makeStyles({
logo: {
width: '120px',
height: '120px',
},
loginButton: {
right: '50px',
}
});
export default function Welcome() {
const classes = useStyles()
return (
<div>
<Box style={{ width: '100%' }} display="flex" justifyContent="center" alignItems="center" >
<Box flexGrow={1}>
<img src={require('../logo.svg')} className={classes.logo} />
</Box>
<Box>
<Button variant="contained" color="primary" className={classes.loginButton}>
Login
</Button>
</Box>
</Box>
</div>
And here is the Login component ( not yet finished ):
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';
const useStyles = makeStyles((theme) => ({
root: {
'& > *': {
margin: theme.spacing(1),
width: '25ch',
},
},
}));
export default function Login() {
const classes = useStyles();
return (
<div>
<TextField id="email" label="Enter email" />
<TextField id="password" label="Enter password" />
</div>
)
}
PS: I'm using react material ui library