mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Bug fix / UI Polish ## What is the current behavior? Interactive menu items in the User Account dropdown (top right profile picture) use the `default` (arrow) cursor. This makes it less intuitive that these items are clickable. Closes #42360 ## What is the new behavior? This PR adds `cursor-pointer` to all interactive menu items in both the [UserDropdown](cci:1://file:///home/erik/Documents/supabase/apps/studio/components/interfaces/UserDropdown.tsx:27:0-140:1) (platform) and [LocalDropdown](cci:1://file:///home/erik/Documents/supabase/apps/studio/components/interfaces/LocalDropdown.tsx:21:0-68:1) (local/self-hosted) components. This provides correct visual feedback to users when hovering over: - Account preferences - Feature previews - Command menu (local) - Theme selections - Logout ## Additional context Verified the changes locally for both [LocalDropdown](cci:1://file:///home/erik/Documents/supabase/apps/studio/components/interfaces/LocalDropdown.tsx:21:0-68:1) and [UserDropdown](cci:1://file:///home/erik/Documents/supabase/apps/studio/components/interfaces/UserDropdown.tsx:27:0-140:1). ### Screenshots Before: <img width="262" height="301" alt="image" src="https://github.com/user-attachments/assets/0c985b1b-065c-49d4-94d4-8dd07fa0ff67" /> After: <img width="262" height="301" alt="image" src="https://github.com/user-attachments/assets/e2ade471-0a84-4405-8e2c-8f757f5dfaf4" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Cursor-pointer indicators added to interactive dropdown items across the app (account settings, feature previews, command menu entries, theme selection radios, logout), improving hover feedback and visual consistency for menu interactions. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
77 lines
2.4 KiB
TypeScript
77 lines
2.4 KiB
TypeScript
import { ProfileImage } from 'components/ui/ProfileImage'
|
|
import { Command, FlaskConical } from 'lucide-react'
|
|
import { useTheme } from 'next-themes'
|
|
import {
|
|
Button,
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuGroup,
|
|
DropdownMenuItem,
|
|
DropdownMenuLabel,
|
|
DropdownMenuRadioGroup,
|
|
DropdownMenuRadioItem,
|
|
DropdownMenuSeparator,
|
|
DropdownMenuTrigger,
|
|
singleThemes,
|
|
Theme,
|
|
} from 'ui'
|
|
import { useSetCommandMenuOpen } from 'ui-patterns'
|
|
|
|
import { useFeaturePreviewModal } from './App/FeaturePreview/FeaturePreviewContext'
|
|
|
|
export const LocalDropdown = () => {
|
|
const { theme, setTheme } = useTheme()
|
|
const setCommandMenuOpen = useSetCommandMenuOpen()
|
|
const { toggleFeaturePreviewModal } = useFeaturePreviewModal()
|
|
|
|
return (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger className="border flex-shrink-0 px-3" asChild>
|
|
<Button
|
|
type="default"
|
|
className="[&>span]:flex px-0 py-0 rounded-full overflow-hidden h-8 w-8"
|
|
>
|
|
<ProfileImage className="w-8 h-8 rounded-md" />
|
|
</Button>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent side="bottom" align="end" className="w-44">
|
|
<DropdownMenuItem
|
|
className="flex gap-2 cursor-pointer"
|
|
onClick={() => toggleFeaturePreviewModal(true)}
|
|
onSelect={() => toggleFeaturePreviewModal(true)}
|
|
>
|
|
<FlaskConical size={14} strokeWidth={1.5} className="text-foreground-lighter" />
|
|
Feature previews
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem
|
|
className="flex gap-2 cursor-pointer"
|
|
onClick={() => setCommandMenuOpen(true)}
|
|
>
|
|
<Command size={14} strokeWidth={1.5} className="text-foreground-lighter" />
|
|
Command menu
|
|
</DropdownMenuItem>
|
|
<DropdownMenuSeparator />
|
|
<DropdownMenuGroup>
|
|
<DropdownMenuLabel>Theme</DropdownMenuLabel>
|
|
<DropdownMenuRadioGroup
|
|
value={theme}
|
|
onValueChange={(value) => {
|
|
setTheme(value)
|
|
}}
|
|
>
|
|
{singleThemes.map((theme: Theme) => (
|
|
<DropdownMenuRadioItem
|
|
key={theme.value}
|
|
value={theme.value}
|
|
className="cursor-pointer"
|
|
>
|
|
{theme.name}
|
|
</DropdownMenuRadioItem>
|
|
))}
|
|
</DropdownMenuRadioGroup>
|
|
</DropdownMenuGroup>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
)
|
|
}
|