-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathButtonAppBar.js
More file actions
76 lines (72 loc) · 1.79 KB
/
ButtonAppBar.js
File metadata and controls
76 lines (72 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import * as React from "react";
import Box from "@mui/material/Box";
import { makeStyles } from "@material-ui/core/styles";
import { Button, CircularProgress } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
backButton: {
backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastText,
"&:hover": {
backgroundColor: theme.palette.primary.dark,
},
},
nextButton: {
backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastText,
"& .MuiButton-root.Mui-disabled": {
backgroundColor: theme.palette.primary.dark,
color: theme.palette.primary.contrastText,
},
"&:hover": {
backgroundColor: theme.palette.primary.dark,
},
},
}));
export default function ButtonAppBar(props) {
const classes = useStyles();
const {
nextHide,
_handleBack,
isSubmitting,
isNextdisabled,
isLastStep,
} = props;
return (
<Box
component="footer"
sx={{
position: "fixed",
bottom: 0,
width: "35%",
}}
>
<Box
sx={{
background: "#F2F5FB",
color: "#1F2327",
height: "48px",
alignItems: "center",
display: "flex",
justifyContent: "space-between",
padding: "8px",
}}
>
<Button className={classes.backButton} onClick={_handleBack}>
Back
</Button>
{!nextHide ? (
<Button
className={classes.nextButton}
disabled={isNextdisabled || isSubmitting}
type="submit"
>
{isLastStep ? "Confirm appointment" : "Next"}
</Button>
) : (
""
)}
{isSubmitting && <CircularProgress size={24} />}
</Box>
</Box>
);
}