11<script setup lang="ts">
22import { ChevronDownIcon } from ' @heroicons/vue/20/solid' ;
3- import Dropdown from ' @/packages/ui/src/Input/Dropdown.vue' ;
4- import DropdownLink from ' @/Components/DropdownLink.vue' ;
5- import { usePage } from ' @inertiajs/vue3' ;
3+ import { Link , usePage } from ' @inertiajs/vue3' ;
4+ import {
5+ Cog6ToothIcon ,
6+ PlusCircleIcon ,
7+ CheckCircleIcon ,
8+ ArrowRightIcon ,
9+ } from ' @heroicons/vue/24/solid' ;
610import type { Organization , User } from ' @/types/models' ;
711import { isBillingActivated } from ' @/utils/billing' ;
812import { canManageBilling } from ' @/utils/permissions' ;
913import { switchOrganization } from ' @/utils/useOrganization' ;
14+ import {
15+ DropdownMenu ,
16+ DropdownMenuTrigger ,
17+ DropdownMenuContent ,
18+ DropdownMenuItem ,
19+ DropdownMenuLabel ,
20+ } from ' @/Components/ui/dropdown-menu' ;
1021
1122const page = usePage <{
1223 jetstream: {
@@ -28,84 +39,79 @@ const switchToTeam = (organization: Organization) => {
2839 </script >
2940
3041<template >
31- <Dropdown v-if =" page.props.jetstream.hasTeamFeatures" align = " center " width = " 60 " >
32- <template # trigger >
42+ <DropdownMenu v-if =" page.props.jetstream.hasTeamFeatures" >
43+ <DropdownMenuTrigger class = " w-full text-left " >
3344 <div
3445 data-testid =" organization_switcher"
35- class =" flex hover:bg-white/10 cursor-pointer transition px -2 py-1 rounded-lg w-full items-center justify-between font-medium " >
46+ class =" flex hover:bg-white/10 cursor-pointer transition pl -2 py-1 rounded w-full items-center justify-between" >
3647 <div class =" flex flex-1 space-x-2 items-center w-[calc(100%-30px)]" >
3748 <div
38- class =" rounded sm:rounded-lg bg-blue-900 font-semibold text-xs sm:text-sm flex-shrink-0 text-white w-5 sm:w-6 h-5 sm:h-6 flex items-center justify-center" >
49+ class =" rounded bg-blue-900 font-medium text-xs flex-shrink-0 text-white w-5 h-5 flex items-center justify-center" >
3950 {{ page.props.auth.user.current_team.name.slice(0, 1).toUpperCase() }}
4051 </div >
41- <span class =" text-sm flex-1 truncate font-semibold " >
52+ <span class =" text-xs flex-1 truncate font-medium " >
4253 {{ page.props.auth.user.current_team.name }}
4354 </span >
4455 </div >
4556 <div class =" w-[30px]" >
46- <button
47- class =" p-1 transition hover:bg-white/10 rounded-full flex items-center w-8 h-8" >
48- <ChevronDownIcon class =" w-5 sm:w-full mt-[1px]" ></ChevronDownIcon >
49- </button >
57+ <div class =" p-1 rounded-full flex items-center w-6 h-6" >
58+ <ChevronDownIcon class =" w-4 sm:w-full mt-[1px]" ></ChevronDownIcon >
59+ </div >
5060 </div >
5161 </div >
52- </template >
62+ </DropdownMenuTrigger >
5363
54- <template # content >
64+ <DropdownMenuContent align = " start " >
5565 <div class =" w-60" >
56- <!-- Organization Management -->
57- <div class =" block px-4 py-2 text-xs text-text-secondary" >Manage Organization</div >
66+ <DropdownMenuLabel >Manage Organization</DropdownMenuLabel >
5867
59- <!-- Organization Settings -->
60- <DropdownLink :href =" route('teams.show', page.props.auth.user.current_team.id)" >
61- Organization Settings
62- </DropdownLink >
68+ <DropdownMenuItem as-child >
69+ <Link
70+ :href =" route('teams.show', page.props.auth.user.current_team.id)"
71+ class =" inline-flex items-center gap-2.5 w-full" >
72+ <Cog6ToothIcon class =" w-5 h-5 text-icon-default" />
73+ <span >Organization Settings</span >
74+ </Link >
75+ </DropdownMenuItem >
6376
64- <DropdownLink v-if =" canManageBilling() && isBillingActivated()" href = " /billing " >
65- Billing
66- </DropdownLink >
77+ <DropdownMenuItem v-if =" canManageBilling() && isBillingActivated()" as-child >
78+ < Link href = " /billing " class = " inline-flex items-center w-full " > Billing </ Link >
79+ </DropdownMenuItem >
6780
68- <DropdownLink
69- v-if =" page.props.jetstream.canCreateTeams"
70- :href =" route('teams.create')" >
71- Create new organization
72- </DropdownLink >
81+ <DropdownMenuItem v-if =" page.props.jetstream.canCreateTeams" as-child >
82+ <Link
83+ :href =" route('teams.create')"
84+ class =" inline-flex items-center gap-2.5 w-full" >
85+ <PlusCircleIcon class =" w-5 h-5 text-icon-default" />
86+ <span >Create new organization</span >
87+ </Link >
88+ </DropdownMenuItem >
7389
74- <!-- Organization Switcher -->
7590 <template v-if =" page .props .auth .user .all_teams .length > 1 " >
7691 <div class =" border-t border-card-background-separator" />
7792
78- <div class =" block px-4 py-2 text-xs text-text-secondary" >
79- Switch Organizations
80- </div >
93+ <DropdownMenuLabel >Switch Organizations</DropdownMenuLabel >
8194
8295 <template v-for =" team in page .props .auth .user .all_teams " :key =" team .id " >
8396 <form @submit.prevent =" switchToTeam(team)" >
84- <DropdownLink as =" button" >
85- <div class =" flex items-center" >
86- <svg
97+ <DropdownMenuItem
98+ as-child
99+ class =" inline-flex gap-2.5 items-center w-full" >
100+ <button type =" submit" >
101+ <CheckCircleIcon
87102 v-if =" team.id == page.props.auth.user.current_team_id"
88- class =" me-2 h-5 w-5 text-green-400"
89- xmlns =" http://www.w3.org/2000/svg"
90- fill =" none"
91- viewBox =" 0 0 24 24"
92- stroke-width =" 1.5"
93- stroke =" currentColor" >
94- <path
95- stroke-linecap =" round"
96- stroke-linejoin =" round"
97- d =" M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
98- </svg >
103+ class =" h-5 w-5 text-green-400" />
104+ <ArrowRightIcon v-else class =" h-5 w-5 text-icon-default" />
99105
100- <div >
106+ <div class = " w-full truncate text-left " >
101107 {{ team.name }}
102108 </div >
103- </div >
104- </DropdownLink >
109+ </button >
110+ </DropdownMenuItem >
105111 </form >
106112 </template >
107113 </template >
108114 </div >
109- </template >
110- </Dropdown >
115+ </DropdownMenuContent >
116+ </DropdownMenu >
111117</template >
0 commit comments