Skip to content

Instantly share code, notes, and snippets.

@manakuro
Last active January 16, 2020 08:47
Show Gist options
  • Save manakuro/3c77d9a47f52c85ecce9c55bb20a71b9 to your computer and use it in GitHub Desktop.
Save manakuro/3c77d9a47f52c85ecce9c55bb20a71b9 to your computer and use it in GitHub Desktop.
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 TextField from '@material-ui/core/TextField';
import Link from '@material-ui/core/Link';
import Grid from '@material-ui/core/Grid';
import Box from '@material-ui/core/Box';
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/core/styles';
import Container from '@material-ui/core/Container';
import { GithubLoginButton } from "react-social-login-buttons";
const useStyles = makeStyles(theme => ({
paper: {
marginTop: theme.spacing(8),
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
},
avatar: {
margin: theme.spacing(1),
backgroundColor: theme.palette.secondary.main,
},
form: {
width: '100%', // Fix IE 11 issue.
marginTop: theme.spacing(3),
},
submit: {
margin: theme.spacing(3, 0, 2),
},
or: {
width: '100%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
marginBottom: 12,
},
github: {
width: '100% !important',
margin: '0 !important',
},
githubText: {
fontSize: '14px !important',
fontWeight: 'bold'
}
}));
const SignUp: React.FC = () => {
const classes = useStyles();
return (
<Container component="main" maxWidth="xs">
<CssBaseline />
<div className={classes.paper}>
<Avatar className={classes.avatar}>
<LockOutlinedIcon />
</Avatar>
<Typography component="h1" variant="h5">
Sign up
</Typography>
<form className={classes.form} noValidate>
<Grid container spacing={2}>
<Grid item xs={12}>
<TextField
variant="outlined"
required
fullWidth
id="email"
label="Email Address"
name="email"
autoComplete="email"
/>
</Grid>
<Grid item xs={12}>
<TextField
variant="outlined"
required
fullWidth
name="password"
label="Password"
type="password"
id="password"
autoComplete="current-password"
/>
</Grid>
</Grid>
<Button
type="submit"
fullWidth
variant="contained"
color="primary"
className={classes.submit}
>
Sign Up
</Button>
<Grid item xs={12}>
<div className={classes.or}>or</div>
</Grid>
</form>
<Grid container spacing={2}>
<Grid item xs={12}>
<GithubLoginButton className={classes.github}>
<span className={classes.githubText}>Sign up with Github</span>
</GithubLoginButton>
</Grid>
<Grid container justify="flex-end">
<Grid item>
<Link href="#" variant="body2">
Already have an account? Sign in
</Link>
</Grid>
</Grid>
</Grid>
</div>
<Box mt={5}>
<Typography variant="body2" color="textSecondary" align="center">
{'Copyright © '}
<Link color="inherit" href="#">
My Website
</Link>{' '}
{new Date().getFullYear()}
{'.'}
</Typography>
</Box>
</Container>
);
}
export default SignUp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment