mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Context This is largely just a mechanical change here: Opting to use lucide icons with the `Icon` suffix across all icon imports within `studio` - so that it’s clearer which components are icons + reduces the possibility of name collision with our own components - e.g <User /> vs <UserIcon /> Also added a eslint rule for this: <img width="1069" height="167" alt="image" src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc" /> And updated `AGENTS.md` as such: ``` Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced). ```
52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
import { MoreVerticalIcon } from 'lucide-react'
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuLabel,
|
|
DropdownMenuRadioGroup,
|
|
DropdownMenuRadioItem,
|
|
DropdownMenuTrigger,
|
|
} from 'ui'
|
|
|
|
import {
|
|
explorerHomeSchema,
|
|
useExplorerPreferences,
|
|
} from '@/components/interfaces/Account/Preferences/useExplorerPreferences'
|
|
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
|
|
|
|
export const ExplorerPreferencesDropdown = () => {
|
|
const { home, setHome, isReady } = useExplorerPreferences()
|
|
|
|
return (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger asChild>
|
|
<ButtonTooltip
|
|
size="tiny"
|
|
variant="outline"
|
|
aria-label="Explorer preferences"
|
|
className="size-7 shrink-0 px-0"
|
|
icon={<MoreVerticalIcon size={14} strokeWidth={1.5} />}
|
|
tooltip={{ content: { side: 'bottom', text: 'Explorer preferences' } }}
|
|
/>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent className="w-44" align="end">
|
|
<DropdownMenuLabel>Open Explorer to</DropdownMenuLabel>
|
|
<DropdownMenuRadioGroup
|
|
value={home}
|
|
onValueChange={(value) => {
|
|
const result = explorerHomeSchema.safeParse(value)
|
|
if (result.success) setHome(result.data)
|
|
}}
|
|
>
|
|
<DropdownMenuRadioItem value="home" disabled={!isReady}>
|
|
Start page
|
|
</DropdownMenuRadioItem>
|
|
<DropdownMenuRadioItem value="query" disabled={!isReady}>
|
|
SQL query
|
|
</DropdownMenuRadioItem>
|
|
</DropdownMenuRadioGroup>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
)
|
|
}
|