Skip to content

Commit

Permalink
added: simple header (desktop), fix: small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTeida committed Jan 19, 2024
1 parent 54a2664 commit 7aed062
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
21 changes: 11 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import './styles/App.scss'
import {Link as RouterLink, Outlet} from "react-router-dom";
import {Container, Typography} from "@mui/joy";
import {Outlet} from "react-router-dom";
import {Box, Container} from "@mui/joy";
import Header from "./components/Header.jsx";

function App() {

return (
<Container sx={{ minHeight: '100dvh' }}>
<Typography>Hello there ;)</Typography>
<nav>
<RouterLink to="/NeuraChatAi/">Homepage</RouterLink>
<RouterLink to="/NeuraChatAi/about">About</RouterLink>
</nav>
<Outlet/>
</Container>
<>
<Header />
<Container sx={{ display: 'flex', minHeight: 1 }}>
<Box component="main" className="MainContent" sx={{ flex: 1, m: 2}}>
<Outlet/>
</Box>
</Container>
</>
)
}

Expand Down
33 changes: 33 additions & 0 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {Sheet, Stack, Typography} from "@mui/joy";
import {Link as RouterLink} from "react-router-dom";

function Header () {
return (
<Sheet component="header" stickyHeader
sx={{
display: 'flex',
p: 2,
flexGrow: 1,
maxWidth: 1,
justifyContent: "space-between",
background: "secondary",
}}>
<Stack direction="row"
justifyContent="center"
alignItems="center"
spacing={2}>
<Typography>NeuraChatAi</Typography>
<RouterLink to="/NeuraChatAi/">Homepage</RouterLink>
<RouterLink to="/NeuraChatAi/about">About</RouterLink>
</Stack>
<Stack direction="row"
justifyContent="center"
alignItems="center"
spacing={1}>

</Stack>
</Sheet>
)
}

export default Header
4 changes: 2 additions & 2 deletions src/pages/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export function About() {
<>
<div>About NeuraChatAi</div>
</>
)
}
);
}
5 changes: 5 additions & 0 deletions src/styles/App.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
body {
a {
text-decoration: none;
}
}

0 comments on commit 7aed062

Please sign in to comment.