Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
feat: improve user profile placeholder in nav
Browse files Browse the repository at this point in the history
  • Loading branch information
skylarmb committed Sep 26, 2024
1 parent 73a835f commit 82b91eb
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
35 changes: 24 additions & 11 deletions kontrol-frontend/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ import {
Image,
Spacer,
AvatarBadge,
Menu,
MenuButton,
MenuList,
MenuItem,
Button,
} from "@chakra-ui/react";
import { useNavigate } from "react-router-dom";

const Navbar = () => {
const navigate = useNavigate();

const navigateToPlaceholder = () => {
navigate("profile");
};

return (
<Box
bg="white"
Expand All @@ -21,7 +33,6 @@ const Navbar = () => {
borderBottomColor="gray.100"
>
<Flex h={16} alignItems="center">
{/* Logo */}
<Link href="/" display="flex" alignItems="center">
<Image
src="/logo.png"
Expand All @@ -36,17 +47,19 @@ const Navbar = () => {

<Spacer />

{/* User Profile */}
<Flex alignItems="center">
<Avatar size="sm" name="Charlie Brown">
<AvatarBadge boxSize="1.25em" bg="green.500" />
</Avatar>
<Box ml={2}>
<Text>Charlie Brown</Text>
<Text fontSize="sm" color="gray.500">
ACME Corporation
</Text>
</Box>
<Menu>
<MenuButton as={Button} p={0} bg={"white"}>
<Avatar size="sm">
<AvatarBadge boxSize="1.25em" bg="green.500" />
</Avatar>
</MenuButton>
<MenuList>
<MenuItem onClick={navigateToPlaceholder}>Profile</MenuItem>
<MenuItem onClick={navigateToPlaceholder}>Settings</MenuItem>
<MenuItem onClick={navigateToPlaceholder}>Log in</MenuItem>
</MenuList>
</Menu>
</Flex>
</Flex>
</Box>
Expand Down
5 changes: 5 additions & 0 deletions kontrol-frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import FlowsCreate from "@/pages/FlowsCreate";
import FlowsIndex from "@/pages/FlowsIndex";
import MaturityGates from "@/pages/MaturityGates";
import TrafficConfiguration from "@/pages/TrafficConfiguration";
import Profile from "@/pages/Profile";
import NotFound from "@/pages/NotFound";

import { ErrorBoundary } from "react-error-boundary";
Expand Down Expand Up @@ -60,6 +61,10 @@ const router = createBrowserRouter([
path: "data-configuration",
element: <DataConfiguration />,
},
{
path: "profile",
element: <Profile />,
},
],
},
{
Expand Down
19 changes: 19 additions & 0 deletions kontrol-frontend/src/pages/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import EmptyState from "@/components/EmptyState";
import { BiChevronLeft } from "react-icons/bi";
import { FiUser } from "react-icons/fi";

const Page = () => {
return (
<EmptyState
icon={FiUser}
buttonText="Go back"
buttonIcon={BiChevronLeft}
buttonTo="../traffic-configuration"
>
We’re working on getting this functionality up and running. We’ll let you
know when it’s ready for you!
</EmptyState>
);
};

export default Page;

0 comments on commit 82b91eb

Please sign in to comment.