@@ -38,26 +38,26 @@ const useStyles = makeStyles((theme: Theme) =>
3838 createStyles ( {
3939 root : {
4040 display : 'flex' ,
41- flexWrap : 'wrap' ,
41+ flexWrap : 'wrap'
4242 } ,
4343 margin : {
44- margin : theme . spacing ( 1 ) ,
44+ margin : theme . spacing ( 1 )
4545 } ,
4646 withoutLabel : {
47- marginTop : theme . spacing ( 3 ) ,
47+ marginTop : theme . spacing ( 3 )
4848 } ,
4949 textField : {
50- width : '25ch' ,
51- } ,
52- } ) ,
50+ width : '25ch'
51+ }
52+ } )
5353)
5454
5555interface State {
56- amount : string ;
57- password : string ;
58- weight : string ;
59- weightRange : string ;
60- showPassword : boolean ;
56+ amount : string
57+ password : string
58+ weight : string
59+ weightRange : string
60+ showPassword : boolean
6161}
6262
6363const PasswordDialog = ( props ) => {
@@ -68,7 +68,7 @@ const PasswordDialog = (props) => {
6868 password : '' ,
6969 weight : '' ,
7070 weightRange : '' ,
71- showPassword : false ,
71+ showPassword : false
7272 } )
7373 const handleChange = ( prop : keyof State ) => ( event : React . ChangeEvent < HTMLInputElement > ) => {
7474 setValues ( { ...values , [ prop ] : event . target . value } )
@@ -81,57 +81,62 @@ const PasswordDialog = (props) => {
8181 event . preventDefault ( )
8282 }
8383 return (
84- < Dialog open = { open }
85- onClose = { ( ) => setOpen ( false ) }
86- aria-labelledby = { 'password-dialog' }
84+ < Dialog
85+ open = { open }
86+ onClose = { ( ) => setOpen ( false ) }
87+ aria-labelledby = 'password-dialog'
8788 >
88- < DialogTitle id = { 'password-dialog' } > { title } </ DialogTitle >
89+ < DialogTitle id = 'password-dialog' > { title } </ DialogTitle >
8990 < DialogContent >
9091 < DialogContentText >
9192 { children }
9293 </ DialogContentText >
9394 < FormControl className = { clsx ( classes . margin , classes . textField ) } >
9495 < InputLabel
95- htmlFor = "standard-adornment-password" >
96+ htmlFor = 'standard-adornment-password'
97+ >
9698 Password
9799 </ InputLabel >
98100 < Input
99- id = " standard-adornment-password"
101+ id = ' standard-adornment-password'
100102 autoFocus
101- margin = " dense"
103+ margin = ' dense'
102104 type = { values . showPassword ? 'text' : 'password' }
103105 value = { values . password }
104106 fullWidth
105107 onChange = { handleChange ( 'password' ) }
106108 endAdornment = {
107- < InputAdornment position = " end" >
109+ < InputAdornment position = ' end' >
108110 < IconButton
109- aria-label = " toggle password visibility"
111+ aria-label = ' toggle password visibility'
110112 onClick = { handleClickShowPassword }
111113 onMouseDown = { handleMouseDownPassword }
112114 >
113- { values . showPassword ? < Visibility /> : < VisibilityOff /> }
115+ { values . showPassword ? < Visibility /> : < VisibilityOff /> }
114116 </ IconButton >
115117 </ InputAdornment >
116118 }
117119 />
118120 </ FormControl >
119121 </ DialogContent >
120122 < DialogActions >
121- < Button variant = { 'contained' }
122- onClick = { ( ) => {
123- setOpen ( false )
124- onCancel ( )
125- } }
126- color = { 'secondary' } >
123+ < Button
124+ variant = 'contained'
125+ onClick = { ( ) => {
126+ setOpen ( false )
127+ onCancel ( )
128+ } }
129+ color = 'secondary'
130+ >
127131 Cancel
128132 </ Button >
129- < Button variant = { 'contained' }
130- onClick = { ( ) => {
131- setOpen ( false )
132- onConfirm ( values . password )
133- } }
134- color = { 'primary' }
133+ < Button
134+ variant = 'contained'
135+ onClick = { ( ) => {
136+ setOpen ( false )
137+ onConfirm ( values . password )
138+ } }
139+ color = 'primary'
135140 >
136141 Accept
137142 </ Button >
0 commit comments