Skip to content

Commit ee56e6f

Browse files
authored
Merge pull request #69 from UMSATS/T44
Add a Help Icon to the Topbar
2 parents bde7c88 + 95cac98 commit ee56e6f

3 files changed

Lines changed: 36 additions & 28 deletions

File tree

client/package-lock.json

Lines changed: 1 addition & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/components/Header.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import Toolbar from "@mui/material/Toolbar";
66
import Button from "@mui/material/Button";
77
import { Link } from 'react-router-dom';
88
import TimeRangePicker from "./TimeRangePicker.jsx";
9-
9+
import HelpDialog from "./HelpDialog.jsx";
10+
1011
export default function Header(){
1112
const LayoutContext = useLayoutContext();
12-
13+
const [helpOpen, setHelpOpen] = React.useState(false);
14+
1315
return(
1416
<AppBar position='sticky'>
1517
<Toolbar disableGutters>
@@ -34,6 +36,15 @@ export default function Header(){
3436
Login
3537
</Button>
3638
</Link>
39+
<HelpDialog open={helpOpen} onClose={() => setHelpOpen(false)} />
40+
<Button onClick={() => setHelpOpen(true)}
41+
sx={{
42+
color: 'white',
43+
bgcolor: 'black',
44+
}}
45+
>
46+
Help
47+
</Button>
3748
</styles.HeaderRightBox>
3849
</Toolbar>
3950
</AppBar>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import Dialog from '@mui/material/Dialog';
3+
import DialogTitle from '@mui/material/DialogTitle';
4+
import DialogContent from '@mui/material/DialogContent';
5+
import DialogActions from '@mui/material/DialogActions';
6+
import Button from '@mui/material/Button';
7+
8+
function HelpDialog({ open, onClose }) {
9+
return (
10+
<Dialog open={open} onClose={onClose}>
11+
<DialogTitle>Help</DialogTitle>
12+
<DialogContent>
13+
hello you have reached the help pop-up
14+
</DialogContent>
15+
<DialogActions>
16+
<Button onClick={onClose}>CLOSE</Button>
17+
</DialogActions>
18+
</Dialog>
19+
);
20+
}
21+
22+
export default HelpDialog;

0 commit comments

Comments
 (0)