Skip to content

Commit

Permalink
Update Navigation.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
sky-ash authored Nov 4, 2024
1 parent ce91845 commit a99da25
Showing 1 changed file with 18 additions and 81 deletions.
99 changes: 18 additions & 81 deletions src/components/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ export default function Navigation() {
const location = useLocation();
if (location.pathname === '/') {
return (
<AppBar position="fixed"
bgcolor="background.paper"
p={2}
sx={{ top: 'auto',
bottom: 0,
}}>

<Toolbar>

<Link to="/path">
<Fab color="primary"
variant='extended'
sx={{ position: 'fixed', zIndex: 1,
left: '50%', transform: 'translateX(-50%)',
bottom: 32, }}>
<Typography display='flex'
sx={{ position: 'absolute', zIndex: 1,
margin: '0 auto', top: -20,
left: 0, right: 0, }}>
<Typography display='flex'
p={2}
alignItems='center'
variant='h6'
Expand All @@ -34,10 +42,10 @@ export default function Navigation() {
</Typography>
</Fab>
</Link>
</Toolbar>
</AppBar>
);
}

else if (location.pathname === '/path') {
} else if (location.pathname === '/path') {
return (
<AppBar position="fixed"
bgcolor="background.paper"
Expand Down Expand Up @@ -77,9 +85,7 @@ export default function Navigation() {

</AppBar>
);
}

else if (location.pathname === '/settings') {
} else if (location.pathname === '/settings' || location.pathname === '/sources') {
return (
<AppBar position="fixed"
bgcolor="background.paper"
Expand Down Expand Up @@ -110,76 +116,7 @@ export default function Navigation() {

</AppBar>
);
}
else if (location.pathname === '/sources') {
return (
<AppBar position="fixed"
bgcolor="background.paper"
p={2}
sx={{ top: 'auto',
bottom: 0,
}}>
<Toolbar>

<Link to="/" sx={{alignItems: 'flex-start'}}>
<IconButton color="primary">
<HomeIcon />
</IconButton>
</Link>

<Box sx={{flexGrow: 1}} />

<Link to="/path">
<IconButton
color="primary"
>
<TurnLeft />
</IconButton>
</Link>

</Toolbar>

</AppBar>
);
}
else if (location.pathname.startsWith('/lecture/')) {
return (
<AppBar position="fixed"
bgcolor="background.paper"
p={2}
sx={{ top: 'auto',
bottom: 0
}}>

<Link to="/path">
<Fab color="primary"
sx={{ position: 'absolute', zIndex: 1,
margin: '0 auto', top: -20,
left: 0, right: 0, }}>
<NavigationIcon />
</Fab>
</Link>

<Toolbar>
<Link to="/" sx={{alignItems: 'flex-start'}}>
<IconButton color="primary">
<HomeIcon />
</IconButton>
</Link>

<Box sx={{flexGrow: 1}} />

<Link to="/path" sx={{alignItems: 'flex-end'}}>
<IconButton color="primary">
<TurnLeft />
</IconButton>
</Link>

</Toolbar>
</AppBar>
);
}
else {
} else {
return null
}

Expand Down

0 comments on commit a99da25

Please sign in to comment.