From 8e92c3bf86b43ac6879a8b2540e4191a22fbcfef Mon Sep 17 00:00:00 2001 From: Eva Decker Date: Sun, 24 Nov 2024 20:01:05 -0500 Subject: [PATCH] feat: Display selected theme, reorder menu (#209) --- .changeset/sixty-impalas-beam.md | 5 + convex/constants.ts | 3 +- src/components/AppSidebar/AppSidebar.tsx | 116 +++++++++++++---------- src/components/Menu/Menu.tsx | 5 +- 4 files changed, 72 insertions(+), 57 deletions(-) create mode 100644 .changeset/sixty-impalas-beam.md diff --git a/.changeset/sixty-impalas-beam.md b/.changeset/sixty-impalas-beam.md new file mode 100644 index 0000000..7f7c539 --- /dev/null +++ b/.changeset/sixty-impalas-beam.md @@ -0,0 +1,5 @@ +--- +"namesake": minor +--- + +Display selected theme name in user menu diff --git a/convex/constants.ts b/convex/constants.ts index 1853ef6..b3a2bcc 100644 --- a/convex/constants.ts +++ b/convex/constants.ts @@ -18,6 +18,7 @@ import { History, House, Landmark, + LaptopMinimal, LetterText, ListChecks, LoaderCircle, @@ -149,7 +150,7 @@ export type Theme = "system" | "light" | "dark"; export const THEMES: Record = { system: { label: "System", - icon: Computer, + icon: LaptopMinimal, }, light: { label: "Light", diff --git a/src/components/AppSidebar/AppSidebar.tsx b/src/components/AppSidebar/AppSidebar.tsx index a96a45d..be56c82 100644 --- a/src/components/AppSidebar/AppSidebar.tsx +++ b/src/components/AppSidebar/AppSidebar.tsx @@ -1,7 +1,7 @@ import { useAuthActions } from "@convex-dev/auth/react"; import { api } from "@convex/_generated/api"; import { THEMES, type Theme } from "@convex/constants"; -import { useMutation, useQuery } from "convex/react"; +import { Authenticated, useMutation, useQuery } from "convex/react"; import { CircleUser, Cog, @@ -85,59 +85,71 @@ export const AppSidebar = ({ children }: AppSidebarProps) => {
{children}
- - - - + + + + + About Namesake - )} - - - Support… - - - Sign out - - - + + {isAdmin && ( + + Admin + + )} + + Settings + + + + Theme + + {THEMES[theme as Theme].label} + + + + + {Object.entries(THEMES).map(([theme, details]) => ( + + {details.label} + + ))} + + + + + + Discord Community + + + + Sign out + + + +
); diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index e50cf4a..d6b361f 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -64,10 +64,7 @@ export function MenuItem({ className, icon: Icon, ...props }: MenuItemProps) { {children} {hasSubmenu && ( - + )} ),