Skip to content

Commit 031e128

Browse files
committed
refactor: replace Button with SidebarMenuButton in AppSidebar and update sidebar width variables in DashboardLayout
1 parent 1bc4a83 commit 031e128

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

services/frontend/src/components/AppSidebar.vue

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,20 @@ onMounted(() => {
126126
<SidebarMenuItem>
127127
<DropdownMenu>
128128
<DropdownMenuTrigger as-child>
129-
<!-- Using Button for consistency with shadcn-vue SidebarMenuButton structure -->
130-
<Button variant="ghost" size="lg" class="w-full justify-start items-center data-[state=open]:bg-accent data-[state=open]:text-accent-foreground px-2 h-auto py-2.5">
131-
<div class="flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground mr-2 shrink-0">
129+
<SidebarMenuButton size="lg" class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground">
130+
<div class="flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground">
132131
<Users class="size-4" />
133132
</div>
134133
<div class="grid flex-1 text-left text-sm leading-tight">
135134
<span class="truncate font-semibold">
136135
{{ selectedTeam?.name || t('sidebar.teams.selectTeam') }}
137136
</span>
138-
<span class="truncate text-xs text-muted-foreground">
137+
<span class="truncate text-xs text-sidebar-foreground/70">
139138
{{ teamsLoading ? t('sidebar.teams.loading') : teams.length > 0 ? `${teams.length} team${teams.length !== 1 ? 's' : ''}` : t('sidebar.teams.noTeams') }}
140139
</span>
141140
</div>
142-
<ChevronDown class="ml-2 size-4 text-muted-foreground shrink-0" />
143-
</Button>
141+
<ChevronDown class="ml-auto size-4" />
142+
</SidebarMenuButton>
144143
</DropdownMenuTrigger>
145144
<DropdownMenuContent
146145
class="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
@@ -206,20 +205,19 @@ onMounted(() => {
206205
<SidebarMenuItem>
207206
<DropdownMenu>
208207
<DropdownMenuTrigger as-child>
209-
<!-- Using Button for consistency -->
210-
<Button variant="ghost" size="lg" class="w-full justify-start items-center data-[state=open]:bg-accent data-[state=open]:text-accent-foreground px-2 h-auto py-2.5">
211-
<Avatar class="h-8 w-8 rounded-lg mr-2 shrink-0">
208+
<SidebarMenuButton size="lg" class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground">
209+
<Avatar class="h-8 w-8 rounded-lg">
212210
<AvatarImage src="https://www.shadcn-vue.com/avatars/shadcn.jpg" :alt="userName" />
213211
<AvatarFallback class="rounded-lg">
214212
{{ userLoading ? '...' : getUserInitials(userName || userEmail) }}
215213
</AvatarFallback>
216214
</Avatar>
217215
<div class="grid flex-1 text-left text-sm leading-tight">
218216
<span class="truncate font-semibold">{{ userName || userEmail }}</span>
219-
<span class="truncate text-xs text-muted-foreground">{{ userEmail }}</span>
217+
<span class="truncate text-xs text-sidebar-foreground/70">{{ userEmail }}</span>
220218
</div>
221-
<ChevronDown class="ml-2 size-4 text-muted-foreground shrink-0" />
222-
</Button>
219+
<ChevronDown class="ml-auto size-4" />
220+
</SidebarMenuButton>
223221
</DropdownMenuTrigger>
224222
<DropdownMenuContent
225223
class="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"

services/frontend/src/components/DashboardLayout.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ const props = defineProps<Props>()
1313
// For now, defaulting to true.
1414
const defaultOpen = ref(true)
1515
16-
// Define sidebar width using the default values from the sidebar utils
17-
// The sidebar components expect these specific CSS variables
16+
// Define sidebar width using custom values
17+
// Override the collapsed width to 30rem for testing
1818
const sidebarStyle = computed(() => ({
1919
'--sidebar-width': '16rem',
2020
'--sidebar-width-mobile': '18rem',
21-
'--sidebar-width-icon': '3rem',
21+
'--sidebar-width-icon': '4rem',
2222
} as StyleValue))
2323
2424
// A simple ref for the SiteHeader, can be expanded later

0 commit comments

Comments
 (0)