2024-06-26 00:29:53 +01:00
|
|
|
import React, { useState } from 'react';
|
2024-06-19 19:10:14 +01:00
|
|
|
import AppBar from '@mui/material/AppBar';
|
|
|
|
|
import Toolbar from '@mui/material/Toolbar';
|
|
|
|
|
import Typography from '@mui/material/Typography';
|
|
|
|
|
import Button from '@mui/material/Button';
|
|
|
|
|
import IconButton from '@mui/material/IconButton';
|
2024-06-26 00:29:53 +01:00
|
|
|
import MenuIcon from '@mui/icons-material/Menu';
|
2024-06-22 22:06:16 +01:00
|
|
|
import { Link, useNavigate } from 'react-router-dom';
|
2024-06-23 20:49:05 +01:00
|
|
|
import githubIcon from '@assets/github-mark.png'; // Adjust the path to your GitHub icon
|
2024-06-26 00:29:53 +01:00
|
|
|
import {
|
|
|
|
|
Stack,
|
|
|
|
|
Drawer,
|
|
|
|
|
List,
|
|
|
|
|
ListItem,
|
|
|
|
|
ListItemText,
|
|
|
|
|
ListItemButton
|
|
|
|
|
} from '@mui/material';
|
|
|
|
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
|
|
|
import { useTheme } from '@mui/material/styles';
|
2024-06-19 19:10:14 +01:00
|
|
|
|
|
|
|
|
const Navbar: React.FC = () => {
|
2024-06-19 19:38:26 +01:00
|
|
|
const navigate = useNavigate();
|
2024-06-26 00:29:53 +01:00
|
|
|
const theme = useTheme();
|
|
|
|
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
|
|
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
|
|
|
|
|
|
|
|
const toggleDrawer = (open: boolean) => () => {
|
|
|
|
|
setDrawerOpen(open);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const drawerList = (
|
|
|
|
|
<List>
|
|
|
|
|
<ListItemButton onClick={() => navigate('/features')}>
|
|
|
|
|
<ListItemText primary="Features" />
|
|
|
|
|
</ListItemButton>
|
|
|
|
|
<ListItemButton onClick={() => navigate('/about-us')}>
|
|
|
|
|
<ListItemText primary="About Us" />
|
|
|
|
|
</ListItemButton>
|
|
|
|
|
<ListItemButton
|
|
|
|
|
component="a"
|
|
|
|
|
href="https://github.com/iib0011/omni-tools"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
src={githubIcon}
|
|
|
|
|
alt="GitHub"
|
|
|
|
|
style={{ height: '24px', marginRight: '8px' }}
|
|
|
|
|
/>
|
|
|
|
|
<Typography variant="button">Star us</Typography>
|
|
|
|
|
</ListItemButton>
|
|
|
|
|
</List>
|
|
|
|
|
);
|
|
|
|
|
|
2024-06-19 19:10:14 +01:00
|
|
|
return (
|
2024-06-22 22:06:16 +01:00
|
|
|
<AppBar
|
|
|
|
|
position="static"
|
|
|
|
|
style={{ backgroundColor: 'white', color: 'black' }}
|
|
|
|
|
>
|
2024-06-25 01:26:53 +01:00
|
|
|
<Toolbar sx={{ justifyContent: 'space-between', alignItems: 'center' }}>
|
2024-06-22 22:06:16 +01:00
|
|
|
<Typography
|
|
|
|
|
onClick={() => navigate('/')}
|
|
|
|
|
fontSize={20}
|
2024-06-25 01:26:53 +01:00
|
|
|
sx={{ cursor: 'pointer' }}
|
2024-06-22 22:06:16 +01:00
|
|
|
color={'primary'}
|
|
|
|
|
>
|
|
|
|
|
OmniTools
|
|
|
|
|
</Typography>
|
2024-06-26 00:29:53 +01:00
|
|
|
{isMobile ? (
|
|
|
|
|
<>
|
|
|
|
|
<IconButton color="inherit" onClick={toggleDrawer(true)}>
|
|
|
|
|
<MenuIcon />
|
|
|
|
|
</IconButton>
|
|
|
|
|
<Drawer
|
|
|
|
|
anchor="right"
|
|
|
|
|
open={drawerOpen}
|
|
|
|
|
onClose={toggleDrawer(false)}
|
2024-06-25 01:26:53 +01:00
|
|
|
>
|
2024-06-26 00:29:53 +01:00
|
|
|
{drawerList}
|
|
|
|
|
</Drawer>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<Stack direction={'row'}>
|
|
|
|
|
<Button color="inherit">
|
|
|
|
|
<Link
|
|
|
|
|
to="/features"
|
|
|
|
|
style={{ textDecoration: 'none', color: 'inherit' }}
|
|
|
|
|
>
|
|
|
|
|
Features
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button color="inherit">
|
|
|
|
|
<Link
|
|
|
|
|
to="/about-us"
|
|
|
|
|
style={{ textDecoration: 'none', color: 'inherit' }}
|
|
|
|
|
>
|
|
|
|
|
About Us
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
<IconButton
|
|
|
|
|
color="primary"
|
|
|
|
|
href="https://github.com/iib0011/omni-tools"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
2024-06-25 01:26:53 +01:00
|
|
|
>
|
2024-06-26 00:29:53 +01:00
|
|
|
<img
|
|
|
|
|
src={githubIcon}
|
|
|
|
|
alt="GitHub"
|
|
|
|
|
style={{ height: '24px', marginRight: '8px' }}
|
|
|
|
|
/>
|
|
|
|
|
<Typography variant="button">Star us</Typography>
|
|
|
|
|
</IconButton>
|
|
|
|
|
</Stack>
|
|
|
|
|
)}
|
2024-06-19 19:10:14 +01:00
|
|
|
</Toolbar>
|
|
|
|
|
</AppBar>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Navbar;
|