@@ -2,7 +2,7 @@ import { useAuth, useClerk, useOrganization, useOrganizationList } from '@clerk/
22import type { OrganizationMembershipResource } from '@clerk/types' ;
33import { FeatureFlagsKeysEnum } from '@novu/shared' ;
44import { AnimatePresence , motion } from 'motion/react' ;
5- import { useCallback , useRef , useState } from 'react' ;
5+ import { useCallback , useEffect , useRef , useState } from 'react' ;
66import { RiAddCircleLine , RiArrowDownSLine , RiArrowRightSLine , RiLoader4Line } from 'react-icons/ri' ;
77import { Avatar , AvatarFallback , AvatarImage } from '@/components/primitives/avatar' ;
88import {
@@ -75,17 +75,14 @@ function OrganizationListItem({ membership, onSwitch, isSwitching, switchingToId
7575 transition = { { duration : 0.15 } }
7676 >
7777 < DropdownMenuItem
78- className = "group flex cursor-pointer items-center gap-2 rounded-sm border-0 px-2 py-1.5 text-sm focus:bg-accent"
78+ className = "group flex h-9 cursor-pointer items-center gap-2 rounded-sm border-0 px-2 text-sm focus:bg-accent"
7979 onClick = { ( ) => onSwitch ( membership . organization . id ) }
8080 disabled = { isSwitching }
8181 >
8282 < OrganizationAvatar imageUrl = { membership . organization . imageUrl } name = { membership . organization . name } />
83- < Tooltip >
84- < TooltipTrigger asChild >
85- < span className = "flex-1 truncate text-foreground-950 max-w-[180px]" > { membership . organization . name } </ span >
86- </ TooltipTrigger >
87- < TooltipContent > { membership . organization . name } </ TooltipContent >
88- </ Tooltip >
83+
84+ < span className = "flex-1 truncate text-foreground-950 max-w-[180px]" > { membership . organization . name } </ span >
85+
8986 { isCurrentlySwitching ? (
9087 < RiLoader4Line className = "size-4 animate-spin text-foreground-600" />
9188 ) : (
@@ -116,6 +113,12 @@ export function OrganizationDropdown() {
116113 } ,
117114 } ) ;
118115
116+ useEffect ( ( ) => {
117+ if ( isOpen ) {
118+ userMemberships ?. revalidate ?.( ) ;
119+ }
120+ } , [ isOpen ] ) ;
121+
119122 const handleOrganizationSwitch = async ( organizationId : string ) => {
120123 if ( organizationId === orgId || isSwitching ) return ;
121124
@@ -183,7 +186,7 @@ export function OrganizationDropdown() {
183186 className = { cn (
184187 'group relative flex w-full items-center gap-2 rounded-lg px-1.5 py-1.5 transition-all duration-300' ,
185188 'hover:bg-background hover:shadow-sm' ,
186- 'before:absolute before:bottom-0 before:left-0 before:h-0 before:w-full before:border-b before:border-neutral-alpha -100 before:transition-all before:duration-300 before:content-[""]' ,
189+ 'before:absolute before:bottom-0 before:left-0 before:h-0 before:w-full before:border-b before:border-stroke -100 before:transition-all before:duration-300 before:content-[""]' ,
187190 'hover:before:border-transparent' ,
188191 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:bg-background focus-visible:shadow-sm focus-visible:before:border-transparent'
189192 ) }
@@ -223,15 +226,15 @@ export function OrganizationDropdown() {
223226
224227 < DropdownMenuItem
225228 className = { cn (
226- 'flex cursor-pointer items-center gap-2 rounded-none border-t border-neutral-alpha-200 px-3 py-1.5 text-sm transition-shadow focus:bg-accent hover:bg-accent' ,
229+ 'flex h-9 cursor-pointer items-center gap-2 rounded-none border-t border-stroke-100 px-2 text-sm transition-shadow focus:bg-accent hover:bg-accent' ,
227230 isScrolled && 'shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]'
228231 ) }
229232 onSelect = { ( ) => {
230233 window . location . href = ROUTES . SIGNUP_ORGANIZATION_LIST ;
231234 } }
232235 >
233- < RiAddCircleLine className = "size-4" />
234- < span className = "text-foreground-950 " > Create organization</ span >
236+ < RiAddCircleLine className = "size-4 text-text-sub " />
237+ < span className = "text-text-sub " > Create organization</ span >
235238 </ DropdownMenuItem >
236239 </ DropdownMenuContent >
237240 </ DropdownMenu >
0 commit comments