mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 12:55:06 +03:00
- move navigation components to `apps/studio/components/layouts/Navigation` - add [FloatingMobileToolbar](https://github.com/supabase/supabase/pull/43444/changes#diff-3dffe47fd51ca851d612d8728e03b2dc344ec213d4f3a46a824d3fa32a7cc851) as quick access to tools such as search, assistant, inline editor, etc - behind feature flag and feature preview (true by default as it's a bit annoying to have to enable it all the time as previews are stored in local-storage) - fix sidebar panels closing on viewport resizing (regression from previous pr) https://github.com/user-attachments/assets/d6881e3b-5128-4306-bb82-3ca39c755dba <img width="986" height="697" alt="Screenshot 2026-03-12 at 12 40 11" src="https://github.com/user-attachments/assets/da8511e2-7d01-4237-b814-596031c747c5" />
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
import { ChevronsUpDown, GitBranch } from 'lucide-react'
|
|
import { cn, SidebarMenuButton } from 'ui'
|
|
|
|
export interface ProjectBranchSelectorTriggerProps {
|
|
displayProjectName: string
|
|
selectedOrgInitial: string
|
|
isBranch: boolean
|
|
isProductionBranch: boolean
|
|
branchDisplayName: string
|
|
onGoToOrganization: () => void
|
|
onClick?: () => void
|
|
}
|
|
|
|
export function ProjectBranchSelectorTrigger({
|
|
displayProjectName,
|
|
selectedOrgInitial,
|
|
isBranch,
|
|
branchDisplayName,
|
|
onClick,
|
|
}: ProjectBranchSelectorTriggerProps) {
|
|
return (
|
|
<SidebarMenuButton
|
|
size="lg"
|
|
className="group py-1 gap-1.5 w-full flex h-auto text-left data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground touch-manipulation"
|
|
onClick={onClick}
|
|
>
|
|
<div className="relative flex h-8 aspect-square shrink-0 items-center bg-background-muted group-hover:border-stronger justify-center rounded border border-strong text-xs">
|
|
{selectedOrgInitial}
|
|
</div>
|
|
<div className="text-left flex-grow min-w-0">
|
|
<div className="w-full truncate text-foreground leading-tight max-w-[250px]">
|
|
{displayProjectName}
|
|
</div>
|
|
<div
|
|
className={cn(
|
|
'flex items-center gap-0.5',
|
|
isBranch ? 'text-foreground-lighter' : 'text-warning'
|
|
)}
|
|
>
|
|
<GitBranch className="shrink-0 size-3" strokeWidth={1.5} />
|
|
<span className="truncate min-w-0 leading-tight text-xs">{branchDisplayName}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<ChevronsUpDown
|
|
strokeWidth={1.5}
|
|
className="ml-auto text-foreground-lighter !w-4 !h-4 md:hidden md:group-hover:flex"
|
|
/>
|
|
</SidebarMenuButton>
|
|
)
|
|
}
|