-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created navigation bar for root layout
- Loading branch information
1 parent
aaef00e
commit cc0b0f1
Showing
4 changed files
with
162 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import React from "react"; | ||
import NavigationBar from "./NavigationBar"; | ||
|
||
const Layout = ({ children }) => { | ||
return <div>{children}</div>; | ||
return ( | ||
<> | ||
<NavigationBar /> | ||
{children} | ||
</> | ||
); | ||
}; | ||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import * as React from "react"; | ||
import AppBar from "@mui/material/AppBar"; | ||
import Box from "@mui/material/Box"; | ||
import Toolbar from "@mui/material/Toolbar"; | ||
import IconButton from "@mui/material/IconButton"; | ||
import Typography from "@mui/material/Typography"; | ||
import Menu from "@mui/material/Menu"; | ||
import MenuIcon from "@mui/icons-material/Menu"; | ||
import Container from "@mui/material/Container"; | ||
import Button from "@mui/material/Button"; | ||
import MenuItem from "@mui/material/MenuItem"; | ||
import AutoMateLogo from "../../public/Automate_logo.png"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
const pages = ["upload", "profiling", "machine learning"]; | ||
|
||
function NavigationBar() { | ||
const [anchorElNav, setAnchorElNav] = React.useState(null); | ||
|
||
const handleOpenNavMenu = (event) => { | ||
setAnchorElNav(event.currentTarget); | ||
}; | ||
|
||
const handleCloseNavMenu = () => { | ||
setAnchorElNav(null); | ||
}; | ||
|
||
return ( | ||
<AppBar position="static"> | ||
<Container maxWidth="xl"> | ||
<Toolbar disableGutters> | ||
<Box sx={{ display: { xs: "none", md: "flex" }, mr: 1 }}> | ||
<Image width={50} alt="AutoMate Logo" src={AutoMateLogo} /> | ||
</Box> | ||
<Typography | ||
variant="h6" | ||
noWrap | ||
component="a" | ||
href="/" | ||
sx={{ | ||
ml: 2, | ||
mr: 2, | ||
display: { xs: "none", md: "flex" }, | ||
fontFamily: "monospace", | ||
fontWeight: 700, | ||
letterSpacing: ".3rem", | ||
color: "inherit", | ||
textDecoration: "none", | ||
}} | ||
> | ||
AutoMate | ||
</Typography> | ||
|
||
<Box sx={{ flexGrow: 1, display: { xs: "flex", md: "none" } }}> | ||
<IconButton | ||
size="large" | ||
aria-label="Menu Hamburger" | ||
aria-controls="menu-appbar" | ||
aria-haspopup="true" | ||
onClick={handleOpenNavMenu} | ||
color="inherit" | ||
> | ||
<MenuIcon /> | ||
</IconButton> | ||
<Menu | ||
id="menu-appbar" | ||
anchorEl={anchorElNav} | ||
anchorOrigin={{ | ||
vertical: "bottom", | ||
horizontal: "left", | ||
}} | ||
keepMounted | ||
transformOrigin={{ | ||
vertical: "top", | ||
horizontal: "left", | ||
}} | ||
open={Boolean(anchorElNav)} | ||
onClose={handleCloseNavMenu} | ||
sx={{ | ||
display: { xs: "block", md: "none" }, | ||
}} | ||
> | ||
{pages.map((page) => ( | ||
<MenuItem | ||
key={page} | ||
onClick={handleCloseNavMenu} | ||
component={Link} | ||
href={page.replace(" ", "-")} | ||
> | ||
<Typography textAlign="center">{page}</Typography> | ||
</MenuItem> | ||
))} | ||
</Menu> | ||
</Box> | ||
|
||
<Box sx={{ display: { xs: "flex", md: "none" }, mr: 1 }}> | ||
<Image width={50} alt="AutoMate Logo" src={AutoMateLogo} /> | ||
</Box> | ||
<Typography | ||
variant="h5" | ||
noWrap | ||
component="a" | ||
href="/" | ||
sx={{ | ||
mr: 2, | ||
display: { xs: "flex", md: "none" }, | ||
flexGrow: 1, | ||
fontFamily: "monospace", | ||
fontWeight: 700, | ||
letterSpacing: ".3rem", | ||
color: "inherit", | ||
textDecoration: "none", | ||
}} | ||
> | ||
AutoMate | ||
</Typography> | ||
<Box sx={{ flexGrow: 1, display: { xs: "none", md: "flex" } }}> | ||
{pages.map((page) => ( | ||
<Button | ||
key={page} | ||
LinkComponent={Link} | ||
href={page.replace(" ", "-")} | ||
sx={{ my: 2, color: "white", display: "block" }} | ||
> | ||
{page} | ||
</Button> | ||
))} | ||
</Box> | ||
</Toolbar> | ||
</Container> | ||
</AppBar> | ||
); | ||
} | ||
export default NavigationBar; |