-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
522 additions
and
542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import JssProvider from 'react-jss/lib/JssProvider'; | ||
import { | ||
MuiThemeProvider, | ||
createMuiTheme, | ||
createGenerateClassName, | ||
} from '@material-ui/core/styles'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
|
||
import App from './components/App'; | ||
|
||
const app = document.getElementById('app'); | ||
|
||
const theme = createMuiTheme({}); | ||
|
||
const generateClassName = createGenerateClassName(); | ||
|
||
ReactDOM.hydrate( | ||
<BrowserRouter> | ||
<App /> | ||
<JssProvider generateClassName={generateClassName}> | ||
<MuiThemeProvider theme={theme}> | ||
<App /> | ||
</MuiThemeProvider> | ||
</JssProvider> | ||
</BrowserRouter>, | ||
app, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import React from 'react'; | ||
import Avatar from '@material-ui/core/Avatar'; | ||
import Button from '@material-ui/core/Button'; | ||
import CssBaseline from '@material-ui/core/CssBaseline'; | ||
import FormControl from '@material-ui/core/FormControl'; | ||
import Input from '@material-ui/core/Input'; | ||
import InputLabel from '@material-ui/core/InputLabel'; | ||
import LockOutlinedIcon from '@material-ui/icons/LockOutlined'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import { withTheme } from '@material-ui/core/styles'; | ||
import styled from 'styled-components'; | ||
|
||
const Base = styled.main` | ||
width: auto; | ||
display: block; | ||
margin-left: ${theme => theme.spacing.unit * 3}px; | ||
margin-right: ${theme => theme.spacing.unit * 3}px; | ||
${theme => theme.breakpoints.up('md')} { | ||
width: 400; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
;`; | ||
|
||
const PaperStyled = styled(Paper)` | ||
margin-top: ${theme => theme.spacing.unit * 8}px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: ${theme => theme.spacing.unit * 2}px ${theme => theme.spacing.unit * 3}px ${theme => theme.spacing.unit * 3}px; | ||
}} | ||
`; | ||
|
||
const AvatarStyled = styled(Avatar)` | ||
margin: ${theme => theme.spacing.unit}px; | ||
background-color: ${theme => theme.palette.secondary.main}; | ||
`; | ||
|
||
const Form = styled.form` | ||
width: 100%; | ||
margin-top: ${theme => theme.spacing.unit}px; | ||
`; | ||
|
||
const SubmitButtonStyled = styled(Button)` | ||
margin-top: ${theme => theme.spacing.unit * 3}px; | ||
`; | ||
|
||
const SignIn = (props) => { | ||
// eslint-disable-next-line react/prop-types | ||
const { theme } = props; | ||
return ( | ||
<Base {...theme}> | ||
<CssBaseline /> | ||
<PaperStyled {...theme}> | ||
<AvatarStyled {...theme}> | ||
<LockOutlinedIcon /> | ||
</AvatarStyled> | ||
<Typography component="h1" variant="h5"> | ||
Sign in | ||
</Typography> | ||
<Form {...theme}> | ||
<FormControl margin="normal" required fullWidth> | ||
<InputLabel htmlFor="email">Email Address</InputLabel> | ||
<Input id="email" name="email" autoComplete="email" autoFocus /> | ||
</FormControl> | ||
<FormControl margin="normal" required fullWidth> | ||
<InputLabel htmlFor="password">Password</InputLabel> | ||
<Input name="password" type="password" id="password" autoComplete="current-password" /> | ||
</FormControl> | ||
<SubmitButtonStyled | ||
type="submit" | ||
fullWidth | ||
variant="contained" | ||
color="primary" | ||
{...theme} | ||
> | ||
Sign in | ||
</SubmitButtonStyled> | ||
|
||
</Form> | ||
</PaperStyled> | ||
</Base> | ||
); | ||
}; | ||
|
||
export default withTheme()(SignIn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.