Archived
navbar completed
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { ENV } from "../../constants/env";
|
||||
|
||||
const Calendar:React.FC = () => {
|
||||
const Calendar: React.FC = () => {
|
||||
return <span>Calendar</span>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { ENV } from "../../constants/env";
|
||||
|
||||
const Contacts:React.FC = () => {
|
||||
const Contacts: React.FC = () => {
|
||||
return <span>Contacts</span>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,60 @@
|
||||
import { ENV } from "../../constants/env";
|
||||
import React from "react";
|
||||
import { Box, Button } from "@mui/material";
|
||||
import GroupsIcon from "@mui/icons-material/Groups";
|
||||
import AddIcon from "@mui/icons-material/Add";
|
||||
import CallIcon from "@mui/icons-material/Call";
|
||||
import FiberManualRecordIcon from "@mui/icons-material/FiberManualRecord";
|
||||
|
||||
const Home:React.FC = () => {
|
||||
return <span>Home</span>;
|
||||
const Home: React.FC = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
height: "75%",
|
||||
}}
|
||||
>
|
||||
<Box sx={{ flexGrow: 1 }}>hi</Box>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
flexGrow: 1,
|
||||
alignItems: "center",
|
||||
justifyContent: "space-evenly",
|
||||
}}
|
||||
>
|
||||
<Box>
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="outlined"
|
||||
startIcon={<GroupsIcon />}
|
||||
></Button>
|
||||
</Box>
|
||||
<Box>
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="outlined"
|
||||
startIcon={<GroupsIcon />}
|
||||
></Button>
|
||||
</Box>
|
||||
<Box>
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="outlined"
|
||||
startIcon={<GroupsIcon />}
|
||||
></Button>
|
||||
</Box>
|
||||
<Box>
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="outlined"
|
||||
startIcon={<GroupsIcon />}
|
||||
></Button>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default Home;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import { Typography } from "@mui/material";
|
||||
import Box, { BoxProps } from "@mui/material/Box";
|
||||
import { styled } from "@mui/material/styles";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
||||
import AccessTimeIcon from "@mui/icons-material/AccessTime";
|
||||
|
||||
const FormattedBox = styled(Box)<BoxProps>(({ theme }) => ({
|
||||
marginRight: 12,
|
||||
}));
|
||||
|
||||
const Clock: React.FC = () => {
|
||||
const [date, setDate] = useState<Date>(new Date());
|
||||
|
||||
useEffect(() => {
|
||||
setInterval(() => setDate(new Date()), 30000);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Box sx={{ display: "flex" }}>
|
||||
<FormattedBox sx={{ mt: 0.5 }}>
|
||||
<CalendarTodayIcon />
|
||||
</FormattedBox>
|
||||
<FormattedBox>
|
||||
<Typography variant="h6" color="inherit">
|
||||
{date.toLocaleDateString("en-GB", {
|
||||
day: "numeric",
|
||||
month: "short",
|
||||
year: "numeric",
|
||||
})}
|
||||
</Typography>
|
||||
</FormattedBox>
|
||||
<FormattedBox sx={{ mt: 0.5 }}>
|
||||
<AccessTimeIcon />
|
||||
</FormattedBox>
|
||||
<FormattedBox>
|
||||
<Typography variant="h6" color="inherit">
|
||||
{date.toLocaleString("en-US", {
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
hour12: true,
|
||||
})}
|
||||
</Typography>
|
||||
</FormattedBox>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default Clock;
|
||||
@@ -1,21 +1,40 @@
|
||||
import { ENV } from "../../constants/env";
|
||||
import React from "react";
|
||||
import { AppBar, Box, IconButton, Toolbar, Typography } from "@mui/material";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import Clock from "./Clock";
|
||||
import pngLogo from "../../assets/logo-png.png";
|
||||
import { Page } from "./Page";
|
||||
|
||||
const pages: Page[] = [
|
||||
{ name: "Home", url: "/" },
|
||||
{ name: "Contacts", url: "/contacts" },
|
||||
{ name: "Calendar", url: "/calendar" },
|
||||
];
|
||||
|
||||
const Navbar: React.FC = () => {
|
||||
return (
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<Link to="/">Home</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to="/contacts">Contacts</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to="/calendar">Calendar</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<AppBar position="static">
|
||||
<Toolbar variant="dense" disableGutters>
|
||||
<IconButton disableRipple sx={{ mr: 2 }}>
|
||||
<img src={pngLogo} alt="Kitty Katty!" style={{ maxWidth: 130 }} />
|
||||
</IconButton>
|
||||
{pages.map((page, i) => (
|
||||
<Box flexGrow={i == pages.length - 1 ? 1 : 0} sx={{ mr: 3 }}>
|
||||
<Typography
|
||||
variant="h6"
|
||||
color="inherit"
|
||||
component={Link}
|
||||
to={page.url}
|
||||
sx={{ textDecoration: "none" }}
|
||||
>
|
||||
{page.name}
|
||||
</Typography>
|
||||
</Box>
|
||||
))}
|
||||
<Clock />
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
interface Page {
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type { Page };
|
||||
@@ -1,5 +1,3 @@
|
||||
import { ENV } from "../../constants/env";
|
||||
|
||||
const Sidebar: React.FC = () => {
|
||||
return <span>Sidebar</span>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user