1+ import React , { useState } from 'react' ;
2+ import Avatar from '@material-ui/core/Avatar' ;
3+ import Button from '@material-ui/core/Button' ;
4+ import CssBaseline from '@material-ui/core/CssBaseline' ;
5+ import TextField from '@material-ui/core/TextField' ;
6+ import FormControlLabel from '@material-ui/core/FormControlLabel' ;
7+ import Checkbox from '@material-ui/core/Checkbox' ;
8+ import Link from '@material-ui/core/Link' ;
9+ import Grid from '@material-ui/core/Grid' ;
10+ import Box from '@material-ui/core/Box' ;
11+ import EmailOutlinedIcon from '@material-ui/icons/EmailOutlined' ;
12+ import Typography from '@material-ui/core/Typography' ;
13+ import { makeStyles } from '@material-ui/core/styles' ;
14+ import Container from '@material-ui/core/Container' ;
15+ import { useHistory } from "react-router-dom"
16+
17+
18+ function Copyright ( ) {
19+ return (
20+ < Typography variant = "body2" color = "textSecondary" align = "center" >
21+ { 'Copyright © ' }
22+ < Link color = "inherit" href = "https://material-ui.com/" >
23+ Your Website
24+ </ Link > { ' ' }
25+ { new Date ( ) . getFullYear ( ) }
26+ { '.' }
27+ </ Typography >
28+ ) ;
29+ }
30+
31+ const useStyles = makeStyles ( ( theme ) => ( {
32+ paper : {
33+ marginTop : theme . spacing ( 8 ) ,
34+ display : 'flex' ,
35+ flexDirection : 'column' ,
36+ alignItems : 'center' ,
37+ } ,
38+ avatar : {
39+ margin : theme . spacing ( 1 ) ,
40+ backgroundColor : theme . palette . secondary . main ,
41+ } ,
42+ form : {
43+ width : '100%' , // Fix IE 11 issue.
44+ marginTop : theme . spacing ( 1 ) ,
45+ } ,
46+ submit : {
47+ margin : theme . spacing ( 3 , 0 , 2 ) ,
48+ } ,
49+ } ) ) ;
50+
51+ export default function VerifyEmailLink ( props ) {
52+ const history = useHistory ( )
53+ const classes = useStyles ( ) ;
54+
55+ function handleSubmit ( ) {
56+ history . push ( '/' )
57+ }
58+
59+ return (
60+ < Container component = "main" maxWidth = "xs" >
61+ < CssBaseline />
62+ < div className = { classes . paper } >
63+ < Avatar className = { classes . avatar } >
64+ < EmailOutlinedIcon />
65+ </ Avatar >
66+ < Typography component = "h1" variant = "h5" >
67+ Verify Email Link
68+ </ Typography >
69+ < form className = { classes . form } onSubmit = { handleSubmit } noValidate >
70+ < TextField
71+ variant = "outlined"
72+ margin = "normal"
73+ required
74+ fullWidth
75+ id = "email"
76+ label = "Email Address"
77+ name = "email"
78+ autoComplete = "email"
79+ autoFocus
80+ />
81+
82+ < Button
83+ type = "submit"
84+ fullWidth
85+ variant = "contained"
86+ color = "primary"
87+ className = { classes . submit }
88+
89+ >
90+ { history ?. location ?. state ?. btnName }
91+ </ Button >
92+ </ form >
93+ </ div >
94+ < Box mt = { 8 } >
95+ < Copyright />
96+ </ Box >
97+ </ Container >
98+ ) ;
99+ }
0 commit comments