mirror of
https://github.com/supabase/supabase.git
synced 2026-06-17 13:14:06 +08: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" />
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import type { LucideIcon } from 'lucide-react'
|
|
import { cn, TabsTrigger_Shadcn_ } from 'ui'
|
|
|
|
export interface ProjectBranchSelectorSheetTabTriggerProps {
|
|
value: 'organization' | 'project' | 'branch'
|
|
label: string
|
|
icon: LucideIcon
|
|
isMainBranch?: boolean
|
|
isLast: boolean
|
|
}
|
|
|
|
export function ProjectBranchSelectorSheetTabTrigger({
|
|
value,
|
|
label,
|
|
icon: Icon,
|
|
isMainBranch = false,
|
|
isLast,
|
|
}: ProjectBranchSelectorSheetTabTriggerProps) {
|
|
const isBranch = value === 'branch'
|
|
const isProductionBranch = isBranch && isMainBranch
|
|
|
|
return (
|
|
<TabsTrigger_Shadcn_
|
|
value={value}
|
|
className={cn(
|
|
'group relative text-xs flex flex-col items-center gap-1.5 px-4 py-3 data-[state=active]:bg-surface-200 data-[state=active]:border-foreground-light border-b duration-0',
|
|
isProductionBranch &&
|
|
'text-warning data-[state=active]:text-warning hover:text-warning hover:opacity-70'
|
|
)}
|
|
>
|
|
<Icon className="shrink-0" size={16} strokeWidth={1.5} />
|
|
<span className="truncate max-w-full text-xs leading-tight" title={label}>
|
|
{label}
|
|
</span>
|
|
|
|
{!isLast && (
|
|
<svg
|
|
aria-hidden="true"
|
|
width="100%"
|
|
height="100%"
|
|
viewBox="0 0 6 63"
|
|
fill="none"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
className="absolute duration-0 bottom-0 top-0 -right-2 w-3 h-full z-10"
|
|
>
|
|
<path
|
|
d="M5.49365 31L0.493652 0V62L5.49365 31Z"
|
|
className="fill-[hsl(var(--background-dash-sidebar))] group-data-[state=active]:fill-[hsl(var(--background-surface-200))]"
|
|
/>
|
|
<path d="M0.493652 0L5.49365 31L0.493652 62" stroke="hsl(var(--border-default))" />
|
|
</svg>
|
|
)}
|
|
</TabsTrigger_Shadcn_>
|
|
)
|
|
}
|