-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SignUp Page Co-authored-by: Meneguini <[email protected]> Co-authored-by: DukeManh <[email protected]> Co-authored-by: David Humphrey <[email protected]>
- Loading branch information
1 parent
c6e7919
commit 0299b0d
Showing
21 changed files
with
1,600 additions
and
43 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
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
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
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,73 @@ | ||
import { MouseEventHandler, useState } from 'react'; | ||
|
||
import { useRouter } from 'next/router'; | ||
|
||
import Button from '@material-ui/core/Button'; | ||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogActions from '@material-ui/core/DialogActions'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
import DialogContentText from '@material-ui/core/DialogContentText'; | ||
import DialogTitle from '@material-ui/core/DialogTitle'; | ||
|
||
type PopUpProps = { | ||
messageTitle: string; | ||
message: string; | ||
buttonText?: string; | ||
agreeAction?: MouseEventHandler; | ||
disagreeAction?: MouseEventHandler; | ||
agreeButtonText: string; | ||
disagreeButtonText?: string; | ||
simple?: boolean; | ||
}; | ||
|
||
const PopUp = ({ | ||
messageTitle, | ||
message, | ||
agreeAction, | ||
disagreeAction, | ||
agreeButtonText, | ||
disagreeButtonText, | ||
simple, | ||
buttonText, | ||
}: PopUpProps) => { | ||
const [open, setOpen] = useState(true); | ||
|
||
const handleClose = () => { | ||
setOpen(false); | ||
}; | ||
|
||
const router = useRouter(); | ||
|
||
return ( | ||
<> | ||
<Dialog | ||
open={simple ? open : true} | ||
onClose={() => router.push('/')} | ||
aria-labelledby="alert-dialog-title" | ||
aria-describedby="alert-dialog-description" | ||
> | ||
<DialogTitle id="alert-dialog-title">{messageTitle}</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText id="alert-dialog-description">{message}</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
{disagreeAction && ( | ||
<Button onClick={disagreeAction} color="primary"> | ||
{disagreeButtonText} | ||
</Button> | ||
)} | ||
{simple && ( | ||
<Button onClick={handleClose} color="primary"> | ||
{buttonText} | ||
</Button> | ||
)} | ||
<Button onClick={agreeAction} color="primary" autoFocus> | ||
{agreeButtonText} | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
</> | ||
); | ||
}; | ||
|
||
export default PopUp; |
48 changes: 48 additions & 0 deletions
48
src/web/src/components/SignUp/FormFields/CheckBoxInput.tsx
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,48 @@ | ||
import { createStyles, makeStyles } from '@material-ui/core'; | ||
import { useField } from 'formik'; | ||
import FormControl from '@material-ui/core/FormControl'; | ||
import FormGroup from '@material-ui/core/FormGroup'; | ||
import FormHelperText from '@material-ui/core/FormHelperText'; | ||
import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||
import Checkbox from '@material-ui/core/Checkbox'; | ||
|
||
const useStyles = makeStyles(() => | ||
createStyles({ | ||
formInputLabel: { | ||
fontSize: '1.4em', | ||
color: 'black', | ||
}, | ||
formControlLabel: { | ||
fontSize: '1em', | ||
color: '#474747', | ||
}, | ||
}) | ||
); | ||
|
||
type CheckboxProps = { | ||
name: string; | ||
label: string; | ||
checked: boolean; | ||
}; | ||
|
||
const CheckBoxInput = (props: CheckboxProps) => { | ||
const classes = useStyles(); | ||
|
||
const { label, name, checked, ...rest } = props; | ||
const [field, meta] = useField(props); | ||
|
||
return ( | ||
<FormControl {...rest} error={!!meta.error && meta.touched}> | ||
<FormGroup> | ||
<FormControlLabel | ||
control={<Checkbox {...field} checked={checked} />} | ||
label={<span className={classes.formControlLabel}>{label}</span>} | ||
name={name} | ||
/> | ||
</FormGroup> | ||
<FormHelperText>{meta.error && meta.touched ? meta.error : ''}</FormHelperText> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
export default CheckBoxInput; |
Oops, something went wrong.