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

feat: improve user profile placeholder in nav #55

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading