From adddcfeeed94cabb2e71e8fa1de2d87468a5ce47 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 11 Aug 2026 20:05:24 -0400 Subject: [PATCH] feat: add account menu to the sidebar footer --- .../lib/components/layout/app-sidebar.svelte | 44 ++++----- .../src/lib/components/layout/nav-user.svelte | 94 +++++++++++++++++++ .../components/ui/avatar/avatar-badge.svelte | 26 +++++ .../ui/avatar/avatar-fallback.svelte | 20 ++++ .../ui/avatar/avatar-group-count.svelte | 23 +++++ .../components/ui/avatar/avatar-group.svelte | 23 +++++ .../components/ui/avatar/avatar-image.svelte | 17 ++++ .../lib/components/ui/avatar/avatar.svelte | 26 +++++ .../src/lib/components/ui/avatar/index.ts | 22 +++++ 9 files changed, 270 insertions(+), 25 deletions(-) create mode 100644 frontend/src/lib/components/layout/nav-user.svelte create mode 100644 frontend/src/lib/components/ui/avatar/avatar-badge.svelte create mode 100644 frontend/src/lib/components/ui/avatar/avatar-fallback.svelte create mode 100644 frontend/src/lib/components/ui/avatar/avatar-group-count.svelte create mode 100644 frontend/src/lib/components/ui/avatar/avatar-group.svelte create mode 100644 frontend/src/lib/components/ui/avatar/avatar-image.svelte create mode 100644 frontend/src/lib/components/ui/avatar/avatar.svelte create mode 100644 frontend/src/lib/components/ui/avatar/index.ts diff --git a/frontend/src/lib/components/layout/app-sidebar.svelte b/frontend/src/lib/components/layout/app-sidebar.svelte index 9dae4da..096e989 100644 --- a/frontend/src/lib/components/layout/app-sidebar.svelte +++ b/frontend/src/lib/components/layout/app-sidebar.svelte @@ -1,45 +1,48 @@ - + + {#snippet child({ props })} - - {header.title} + + {header.title} {/snippet} @@ -50,15 +53,6 @@ - - {#snippet child({ props })} - - {#if footer.icon} - - {/if} - {footer.title} - - {/snippet} - + diff --git a/frontend/src/lib/components/layout/nav-user.svelte b/frontend/src/lib/components/layout/nav-user.svelte new file mode 100644 index 0000000..c1ec24f --- /dev/null +++ b/frontend/src/lib/components/layout/nav-user.svelte @@ -0,0 +1,94 @@ + + + + + + + {#snippet child({ props })} + + + + {initials} + + +
+ {handle} + {user?.email} +
+ +
+ {/snippet} +
+ + + +
+ + + {initials} + + +
+ {handle} + {user?.email} +
+
+
+ + + + + goto('/settings/account')}> + + Settings + + goto('/settings/appearance')}> + + Appearance + + + + + + { + await logout(); + await goto('/login'); + }} + > + + Log out + +
+
+
+
diff --git a/frontend/src/lib/components/ui/avatar/avatar-badge.svelte b/frontend/src/lib/components/ui/avatar/avatar-badge.svelte new file mode 100644 index 0000000..2df847a --- /dev/null +++ b/frontend/src/lib/components/ui/avatar/avatar-badge.svelte @@ -0,0 +1,26 @@ + + +svg]:hidden", + "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", + "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", + className + )} + {...restProps} +> + {@render children?.()} + diff --git a/frontend/src/lib/components/ui/avatar/avatar-fallback.svelte b/frontend/src/lib/components/ui/avatar/avatar-fallback.svelte new file mode 100644 index 0000000..62f28d9 --- /dev/null +++ b/frontend/src/lib/components/ui/avatar/avatar-fallback.svelte @@ -0,0 +1,20 @@ + + + diff --git a/frontend/src/lib/components/ui/avatar/avatar-group-count.svelte b/frontend/src/lib/components/ui/avatar/avatar-group-count.svelte new file mode 100644 index 0000000..0a0aeb4 --- /dev/null +++ b/frontend/src/lib/components/ui/avatar/avatar-group-count.svelte @@ -0,0 +1,23 @@ + + +
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 relative flex shrink-0 items-center justify-center ring-2 ring-background", + className + )} + {...restProps} +> + {@render children?.()} +
diff --git a/frontend/src/lib/components/ui/avatar/avatar-group.svelte b/frontend/src/lib/components/ui/avatar/avatar-group.svelte new file mode 100644 index 0000000..e558356 --- /dev/null +++ b/frontend/src/lib/components/ui/avatar/avatar-group.svelte @@ -0,0 +1,23 @@ + + +
+ {@render children?.()} +
diff --git a/frontend/src/lib/components/ui/avatar/avatar-image.svelte b/frontend/src/lib/components/ui/avatar/avatar-image.svelte new file mode 100644 index 0000000..f41cf8f --- /dev/null +++ b/frontend/src/lib/components/ui/avatar/avatar-image.svelte @@ -0,0 +1,17 @@ + + + diff --git a/frontend/src/lib/components/ui/avatar/avatar.svelte b/frontend/src/lib/components/ui/avatar/avatar.svelte new file mode 100644 index 0000000..7464798 --- /dev/null +++ b/frontend/src/lib/components/ui/avatar/avatar.svelte @@ -0,0 +1,26 @@ + + + diff --git a/frontend/src/lib/components/ui/avatar/index.ts b/frontend/src/lib/components/ui/avatar/index.ts new file mode 100644 index 0000000..963a923 --- /dev/null +++ b/frontend/src/lib/components/ui/avatar/index.ts @@ -0,0 +1,22 @@ +import Badge from "./avatar-badge.svelte"; +import Fallback from "./avatar-fallback.svelte"; +import GroupCount from "./avatar-group-count.svelte"; +import Group from "./avatar-group.svelte"; +import Image from "./avatar-image.svelte"; +import Root from "./avatar.svelte"; + +export { + Root, + Image, + Fallback, + Badge, + Group, + GroupCount, + // + Root as Avatar, + Image as AvatarImage, + Fallback as AvatarFallback, + Badge as AvatarBadge, + Group as AvatarGroup, + GroupCount as AvatarGroupCount, +};