Merge pull request #32 from spotify/soapraj/login-changes
minor fixes / add grid to login page
This commit is contained in:
@@ -9,8 +9,8 @@ import {
|
||||
BrowserRouter as Router,
|
||||
Switch,
|
||||
Route,
|
||||
Link as RouterLink
|
||||
} from "react-router-dom";
|
||||
Link as RouterLink,
|
||||
} from 'react-router-dom';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
root: {
|
||||
@@ -36,20 +36,19 @@ const useStyles = makeStyles(theme => ({
|
||||
|
||||
const App: FC<{}> = () => {
|
||||
return (
|
||||
<Router>
|
||||
<Switch>
|
||||
<Route exact path="/">
|
||||
<AppShell>
|
||||
<Home />
|
||||
</AppShell>
|
||||
</Route>
|
||||
<Route path="/login">
|
||||
<AppShell>
|
||||
<Login />
|
||||
</AppShell>
|
||||
</Route>
|
||||
</Switch>
|
||||
</Router>);
|
||||
<AppShell>
|
||||
<Router>
|
||||
<Switch>
|
||||
<Route exact path="/">
|
||||
<Home />
|
||||
</Route>
|
||||
<Route path="/login">
|
||||
<Login />
|
||||
</Route>
|
||||
</Switch>
|
||||
</Router>
|
||||
</AppShell>
|
||||
);
|
||||
};
|
||||
|
||||
const Home: FC<{}> = () => {
|
||||
@@ -75,10 +74,10 @@ const Login: FC<{}> = () => {
|
||||
<RouterLink to="/">Go to Home</RouterLink>
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const AppShell: FC<{}> = ({children}) => {
|
||||
const AppShell: FC<{}> = ({ children }) => {
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
@@ -86,12 +85,10 @@ const AppShell: FC<{}> = ({children}) => {
|
||||
<SideBar />
|
||||
<div className={classes.mainContentArea}>
|
||||
<PageHeader />
|
||||
<div className={classes.pageBody}>
|
||||
{children}
|
||||
</div>
|
||||
<div className={classes.pageBody}>{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -1,18 +1,35 @@
|
||||
import React, { FC, Fragment } from 'react';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import TextField from '@material-ui/core/TextField';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
|
||||
const LoginComponent: FC<{}> = () => {
|
||||
return (
|
||||
<Fragment>
|
||||
<TextField variant="outlined" label="Username: " />
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
onClick={() => window.location.href = "/"}
|
||||
<Grid container spacing={8} alignItems="flex-end">
|
||||
<Grid item md={true} sm={true} xs={true}>
|
||||
<TextField
|
||||
id="username"
|
||||
label="Username"
|
||||
type="email"
|
||||
autoFocus
|
||||
required
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid
|
||||
container
|
||||
justify="flex-start"
|
||||
style={{ marginTop: '24px', marginBottom: '24px' }}
|
||||
>
|
||||
Login
|
||||
</Button>
|
||||
<Button
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
style={{ textTransform: 'none' }}
|
||||
>
|
||||
Login
|
||||
</Button>
|
||||
</Grid>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user