1- import  React  from  'react' ; 
1+ import  *   as   React  from  'react' ; 
22import  { ContactFormProps }  from  './interface' ; 
3+ import  Avatar  from  '@material-ui/core/Avatar' ; 
4+ import  Button  from  '@material-ui/core/Button' ; 
5+ import  CssBaseline  from  '@material-ui/core/CssBaseline' ; 
6+ import  TextField  from  '@material-ui/core/TextField' ; 
7+ import  FormControlLabel  from  '@material-ui/core/FormControlLabel' ; 
8+ import  Checkbox  from  '@material-ui/core/Checkbox' ; 
9+ import  Link  from  '@material-ui/core/Link' ; 
10+ import  Grid  from  '@material-ui/core/Grid' ; 
11+ import  Box  from  '@material-ui/core/Box' ; 
12+ import  LockOutlinedIcon  from  '@material-ui/icons/LockOutlined' ; 
13+ import  EmailIcon  from  '@material-ui/icons/Email' ; 
14+ import  Typography  from  '@material-ui/core/Typography' ; 
15+ import  {  makeStyles  }  from  '@material-ui/core/styles' ; 
16+ import  Container  from  '@material-ui/core/Container' ; 
17+ import  TextareaAutosize  from  '@material-ui/core/TextareaAutosize' ; 
318
19+ function  Copyright ( )  { 
20+  return  ( 
21+  < Typography  variant = "body2"  color = "textSecondary"  align = "center" > 
22+  { 'Copyright © ' } 
23+  < Link  color = "inherit"  href = "https://material-ui.com/" > 
24+  Knight Coder LLC
25+  </ Link > { ' ' } 
26+  { new  Date ( ) . getFullYear ( ) } 
27+  { '.' } 
28+  </ Typography > 
29+  ) ; 
30+  } 
31+ 
32+ const  useStyles  =  makeStyles ( ( theme )  =>  ( { 
33+  paper : { 
34+  marginTop : theme . spacing ( 8 ) , 
35+  display : 'flex' , 
36+  flexDirection : 'column' , 
37+  alignItems : 'center' , 
38+  } , 
39+  avatar : { 
40+  margin : theme . spacing ( 1 ) , 
41+  backgroundColor : theme . palette . secondary . main , 
42+  } , 
43+  form : { 
44+  width : '100%' ,  // Fix IE 11 issue. 
45+  marginTop : theme . spacing ( 3 ) , 
46+  } , 
47+  submit : { 
48+  margin : theme . spacing ( 3 ,  0 ,  2 ) , 
49+  } , 
50+ } ) ) ; 
451export  const  ContactForm  =  ( props : ContactFormProps )  =>  { 
5-  return  < form > </ form > 
52+  const  classes  =  useStyles ( ) ; 
53+ 
54+  return  ( 
55+  < Container  component = "main"  maxWidth = "xs" > 
56+  < CssBaseline  /> 
57+  < div  className = { classes . paper } > 
58+  < Avatar  className = { classes . avatar } > 
59+  < EmailIcon  /> 
60+  </ Avatar > 
61+  < Typography  component = "h1"  variant = "h5" > 
62+  Sign up
63+  </ Typography > 
64+  < form  className = { classes . form }  noValidate > 
65+  < Grid  container  spacing = { 2 } > 
66+  < Grid  item  xs = { 12 }  sm = { 6 } > 
67+  < TextField 
68+  autoComplete = "fname" 
69+  name = "firstName" 
70+  variant = "outlined" 
71+  required 
72+  fullWidth 
73+  id = "firstName" 
74+  label = "First Name" 
75+  autoFocus 
76+  /> 
77+  </ Grid > 
78+  < Grid  item  xs = { 12 }  sm = { 6 } > 
79+  < TextField 
80+  variant = "outlined" 
81+  required 
82+  fullWidth 
83+  id = "lastName" 
84+  label = "Last Name" 
85+  name = "lastName" 
86+  autoComplete = "lname" 
87+  /> 
88+  </ Grid > 
89+  < Grid  item  xs = { 12 } > 
90+  < TextField 
91+  variant = "outlined" 
92+  required 
93+  fullWidth 
94+  id = "email" 
95+  label = "Email Address" 
96+  name = "email" 
97+  autoComplete = "email" 
98+  /> 
99+  </ Grid > 
100+  < Grid  item  xs = { 12 } > 
101+  < TextField 
102+  variant = "outlined" 
103+  required 
104+  fullWidth 
105+  name = "message" 
106+  label = "Message" 
107+  type = "textarea" 
108+  id = "message" 
109+  multiline = { true } 
110+  /> 
111+  </ Grid > 
112+  < Grid  item  xs = { 12 } > 
113+  < FormControlLabel 
114+  control = { < Checkbox  value = "allowExtraEmails"  color = "primary"  /> } 
115+  label = "I want to receive inspiration, marketing promotions and updates via email." 
116+  /> 
117+  </ Grid > 
118+  </ Grid > 
119+  < Button 
120+  type = "submit" 
121+  fullWidth 
122+  variant = "contained" 
123+  color = "primary" 
124+  className = { classes . submit } 
125+  > 
126+  Submit
127+  </ Button > 
128+  { /* <Grid container justify="flex-end"> 
129+  <Grid item> 
130+  <Link href="#" variant="body2"> 
131+  Chatbot 
132+  </Link> 
133+  </Grid> 
134+  </Grid> */ } 
135+  </ form > 
136+  </ div > 
137+  < Box  mt = { 5 } > 
138+  < Copyright  /> 
139+  </ Box > 
140+  </ Container > 
141+  ) ; 
6142} 
0 commit comments