mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +03:00
## Summary - Removes the `SupaIcon` component (inline Supabase SVG logo) from `LogsSidebarMenuV2.tsx` - Removes the `icon` prop from the Collections and Database operations sidebar items - Makes `icon` optional in `LogsSidebarItem` so the span is only rendered when an icon is provided Closes FE-3203 ## Test plan - [ ] Navigate to Logs & Analytics in Studio - [ ] Confirm Collections and Database operations sidebar items no longer show the Supabase logo - [ ] Confirm Saved Queries items still show the SQL editor icon (unaffected) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Updated the logs sidebar component to make icon display optional. * Removed icons from sidebar items in the logs navigation to streamline the interface presentation. [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45787) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
import { MoreHorizontal } from 'lucide-react'
|
|
import Link from 'next/link'
|
|
import { type MouseEventHandler } from 'react'
|
|
import { Button, cn, DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from 'ui'
|
|
|
|
type Props = {
|
|
label: string
|
|
icon?: React.ReactNode
|
|
dropdownItems?: React.ReactNode
|
|
href: string
|
|
isActive: boolean
|
|
onClick?: MouseEventHandler<HTMLAnchorElement>
|
|
}
|
|
export function LogsSidebarItem({ label, icon, dropdownItems, href, isActive, onClick }: Props) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
{
|
|
'bg-foreground-lighter/10': isActive,
|
|
},
|
|
'relative flex [&:has([data-state=open])]:bg-foreground-lighter/10 [&:has([data-state=open])]:text-foreground hover:text-foreground hover:bg-foreground-lighter/10 transition-all text-foreground-light group'
|
|
)}
|
|
>
|
|
<Link
|
|
onClick={onClick}
|
|
href={href}
|
|
className={'h-7 flex-1 text-sm px-4 flex items-center gap-2 truncate'}
|
|
>
|
|
{icon && <span>{icon}</span>}
|
|
<span className="truncate">{label}</span>
|
|
</Link>
|
|
{dropdownItems && (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger
|
|
asChild
|
|
onClick={(e) => {
|
|
// Prevents clicking the dropdown from also clicking the parent link and navigating to it
|
|
e.preventDefault()
|
|
}}
|
|
>
|
|
<Button
|
|
type="text"
|
|
title="Actions"
|
|
className="space-x-0 h-7 px-1.5 opacity-0 group-hover:opacity-100 bg-transparent! data-open:opacity-100"
|
|
icon={<MoreHorizontal size={14} />}
|
|
>
|
|
<div className="sr-only">Actions</div>
|
|
</Button>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent className="w-48" align="end">
|
|
{dropdownItems}
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|