diff options
author | Sascha <GlancingMind@outlook.com> | 2021-03-20 10:37:49 +0100 |
---|---|---|
committer | Sascha <GlancingMind@outlook.com> | 2021-03-21 17:43:06 +0100 |
commit | 8d8eb2942f73213b175529f47af980889cd080d4 (patch) | |
tree | a1217a99f5cf57b56f82e1f8b9b16d6d2a385851 /webui/src | |
parent | 07e1c45cd70554630640bb1ea25968078a36fd6c (diff) | |
download | git-bug-8d8eb2942f73213b175529f47af980889cd080d4.tar.gz |
Add test navbar
Diffstat (limited to 'webui/src')
-rw-r--r-- | webui/src/components/Header/Header.tsx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/webui/src/components/Header/Header.tsx b/webui/src/components/Header/Header.tsx index 3443fcf5..5a968a29 100644 --- a/webui/src/components/Header/Header.tsx +++ b/webui/src/components/Header/Header.tsx @@ -2,6 +2,8 @@ import React from 'react'; import { Link } from 'react-router-dom'; import AppBar from '@material-ui/core/AppBar'; +import Tab from '@material-ui/core/Tab'; +import Tabs from '@material-ui/core/Tabs'; import Toolbar from '@material-ui/core/Toolbar'; import { makeStyles } from '@material-ui/core/styles'; @@ -35,6 +37,45 @@ const useStyles = makeStyles((theme) => ({ }, })); +function a11yProps(index: any) { + return { + id: `nav-tab-${index}`, + 'aria-controls': `nav-tabpanel-${index}`, + }; +} + +function NavTabs() { + const [value, setValue] = React.useState(0); + + //TODO page refresh resets state. Must parse url to determine which tab is + //highlighted + const handleChange = (event: React.ChangeEvent<{}>, newValue: number) => { + setValue(newValue); + }; + + + return ( + <Tabs + variant="fullWidth" + value={value} + onChange={handleChange} + aria-label="nav tabs example" + > + <Tab label="Code" component="a" href="/code" {...a11yProps(0)} /> + <Tab label="Bugs" component="a" href="/" {...a11yProps(1)} /> + <Tab + label="Pull Requests" + component="a" + href="/pulls" + {...a11yProps(2)} + /> + <Tab label="Projects" component="a" href="/projects" {...a11yProps(3)} /> + <Tab label="Wiki" component="a" href="/wiki" {...a11yProps(4)} /> + <Tab label="Settings" component="a" href="/settings" {...a11yProps(5)} /> + </Tabs> + ); +} + function Header() { const classes = useStyles(); @@ -54,6 +95,7 @@ function Header() { </Toolbar> </AppBar> <div className={classes.offset} /> + <NavTabs /> </> ); } |