Skip to content

Commit 0ef91e8

Browse files
committed
chore: wip
1 parent b12c810 commit 0ef91e8

File tree

1 file changed

+85
-19
lines changed
  • storage/framework/defaults/components/Dashboard

1 file changed

+85
-19
lines changed

storage/framework/defaults/components/Dashboard/Sidebar.vue

Lines changed: 85 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const sectionContent: Record<string, SectionContent> = {
189189
},
190190
data: {
191191
items: [
192-
{ to: '/models', icon: 'i-hugeicons-dashboard-browsing', text: 'Dashboard' },
192+
{ to: '/models', icon: 'i-hugeicons-dashboard-speed-01', text: 'Dashboard' },
193193
{ to: '/models/users', letter: 'U', text: 'Users' },
194194
{ to: '/models/teams', letter: 'T', text: 'Teams' },
195195
{ to: '/models/subscribers', letter: 'S', text: 'Subscribers' }
@@ -408,24 +408,36 @@ const switchTeam = (team: Team) => {
408408
</div>
409409
</RouterLink>
410410

411-
<ul
412-
v-if="item.children"
413-
role="list"
414-
class="mt-1 space-y-1 overflow-hidden transition-all duration-300"
415-
:class="{
416-
'max-h-0 opacity-0': !expandedItems[item.to],
417-
'max-h-40 opacity-100': expandedItems[item.to] && item.children.length <= 3 && item.to !== '#commerce',
418-
'commerce-dropdown': expandedItems[item.to] && item.to === '#commerce',
419-
'queue-dropdown': expandedItems[item.to] && item.to === '#queue'
420-
}"
421-
>
422-
<li v-for="child in item.children" :key="child.to">
423-
<RouterLink :to="child.to" class="sidebar-child-link group">
424-
<div :class="[child.icon, 'h-5 w-5 text-gray-400 transition duration-150 ease-in-out dark:text-gray-200 group-hover:text-gray-700 mt-0.5']" />
425-
<span class="truncate">{{ child.text }}</span>
426-
</RouterLink>
427-
</li>
428-
</ul>
411+
<div v-if="item.to === '#commerce'" class="relative">
412+
<div
413+
v-if="expandedItems[item.to]"
414+
class="commerce-dropdown-container"
415+
>
416+
<div v-for="child in item.children" :key="child.to" class="commerce-dropdown-item">
417+
<RouterLink :to="child.to" class="sidebar-child-link group pl-8">
418+
<div :class="[child.icon, 'h-5 w-5 text-gray-400 transition duration-150 ease-in-out dark:text-gray-200 group-hover:text-gray-700 mt-0.5']" />
419+
<span class="truncate">{{ child.text }}</span>
420+
</RouterLink>
421+
</div>
422+
</div>
423+
</div>
424+
425+
<!-- Use transition for other dropdowns -->
426+
<transition name="dropdown" v-if="item.to !== '#commerce'">
427+
<ul
428+
v-if="item.children && expandedItems[item.to]"
429+
role="list"
430+
class="mt-1 space-y-1 dropdown-list"
431+
:style="{ 'max-height': '100px' }"
432+
>
433+
<li v-for="child in item.children" :key="child.to" class="dropdown-item">
434+
<RouterLink :to="child.to" class="sidebar-child-link group">
435+
<div :class="[child.icon, 'h-5 w-5 text-gray-400 transition duration-150 ease-in-out dark:text-gray-200 group-hover:text-gray-700 mt-0.5']" />
436+
<span class="truncate">{{ child.text }}</span>
437+
</RouterLink>
438+
</li>
439+
</ul>
440+
</transition>
429441
</div>
430442
</li>
431443
</ul>
@@ -577,4 +589,58 @@ li[draggable="true"].dragging .drag-handle {
577589
.queue-dropdown {
578590
@apply max-h-40 opacity-100;
579591
}
592+
593+
.dropdown-enter-active,
594+
.dropdown-leave-active {
595+
transition: all 0.3s ease;
596+
}
597+
598+
.dropdown-enter-from,
599+
.dropdown-leave-to {
600+
opacity: 0;
601+
max-height: 0 !important;
602+
}
603+
604+
/* Commerce dropdown specific styling */
605+
.commerce-dropdown-container {
606+
width: 100%;
607+
background-color: white;
608+
border-radius: 0.375rem;
609+
margin-top: 0.25rem;
610+
z-index: 10;
611+
animation: fadeIn 0.3s ease;
612+
padding: 0.25rem 0;
613+
}
614+
615+
.commerce-dropdown-item {
616+
margin-bottom: 0.25rem;
617+
display: block;
618+
width: 100%;
619+
}
620+
621+
.commerce-dropdown-item .sidebar-child-link {
622+
padding-left: 2rem;
623+
display: flex;
624+
align-items: center;
625+
gap: 0.75rem;
626+
}
627+
628+
@keyframes fadeIn {
629+
from { opacity: 0; }
630+
to { opacity: 1; }
631+
}
632+
633+
.dropdown-list {
634+
overflow-y: auto;
635+
}
636+
637+
.dropdown-item {
638+
height: 40px;
639+
}
640+
641+
@media (prefers-color-scheme: dark) {
642+
.commerce-dropdown-container {
643+
background-color: #1e293b; /* dark:bg-blue-gray-800 */
644+
}
645+
}
580646
</style>

0 commit comments

Comments
 (0)