source: frontend/src/components/modals/role-modal.jsx@ badbc79

Last change on this file since badbc79 was badbc79, checked in by Luka Cheshlarov <luka.cheshlarov@…>, 20 months ago

Initial commit

  • Property mode set to 100644
File size: 1.9 KB
Line 
1import {Dialog, DialogContent, DialogTitle, Grid, IconButton, Typography} from "@mui/material";
2import RoleCard from "../cards/role-card";
3import CloseIcon from "@mui/icons-material/Close";
4import {UserRole} from "../../services/user-service";
5
6
7const ChooseRole = ({roleset, ...props}) => {
8
9 const handleRole = role => {
10 props.onClose();
11 roleset(role);
12 }
13
14 return (
15 <Dialog
16 {...props}
17 disablebackdropclick="true"
18 fullWidth={true}
19 maxWidth={"lg"}
20 aria-labelledby="choose-role-title"
21 >
22 <DialogTitle variant="h4" disabletypography="true" id={"choose-role-title"}
23 className={"text-center font-weight-bolder"}>
24 Choose your role
25 <IconButton className={"float-end"} aria-label="close" onClick={() => props.onClose()}>
26 <CloseIcon/>
27 </IconButton>
28 </DialogTitle>
29
30 <DialogContent className={"mb-3"}>
31 <Grid container spacing={2}>
32 <Grid className={"border-effect"} onClick={() => handleRole(UserRole.Potrosuvac)} item md={4} lg={4}
33 xs={12}>
34 <RoleCard role={UserRole.Potrosuvac}/>
35 </Grid>
36 <Grid className={"border-effect"} onClick={() => handleRole(UserRole.Menager)} item md={4} lg={4}
37 xs={12}>
38 <RoleCard role={UserRole.Menager}/>
39 </Grid>
40 <Grid className={"border-effect"} onClick={() => handleRole(UserRole.Vozac)} item md={4} lg={4}
41 xs={12}>
42 <RoleCard role={UserRole.Vozac}/>
43 </Grid>
44 </Grid>
45 </DialogContent>
46 </Dialog>
47 )
48}
49
50export default ChooseRole;
Note: See TracBrowser for help on using the repository browser.