mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 05:39:11 +03:00
fix nav v2 build
This commit is contained in:
2 files changed
+39
-40
No files matched your search
+38
-39
@@ -1,7 +1,8 @@
|
||||
import { useIsNavigationV2Enabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
|
||||
import { ChevronsUpDown, GitBranch } from 'lucide-react'
|
||||
import { cn, SidebarMenuButton as SidebarMenuButtonComponent } from 'ui'
|
||||
import * as React from 'react'
|
||||
import { forwardRef } from 'react'
|
||||
import { cn, SidebarMenuButton as SidebarMenuButtonComponent } from 'ui'
|
||||
|
||||
export interface ProjectBranchSelectorTriggerProps {
|
||||
displayProjectName: string
|
||||
@@ -19,48 +20,46 @@ export const ProjectBranchSelectorTrigger = React.forwardRef<
|
||||
React.ComponentPropsWithoutRef<typeof SidebarMenuButtonComponent>,
|
||||
keyof ProjectBranchSelectorTriggerProps
|
||||
>
|
||||
>(({ displayProjectName, selectedOrgInitial, isBranch, branchDisplayName, ...buttonProps }, ref) => {
|
||||
const isNavigationV2 = useIsNavigationV2Enabled()
|
||||
>(
|
||||
(
|
||||
{ displayProjectName, selectedOrgInitial, isBranch, branchDisplayName, ...buttonProps },
|
||||
ref
|
||||
) => {
|
||||
const isNavigationV2 = useIsNavigationV2Enabled()
|
||||
|
||||
return (
|
||||
<SidebarMenuButtonComponent
|
||||
ref={ref}
|
||||
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"
|
||||
{...buttonProps}
|
||||
>
|
||||
<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={cn(
|
||||
'w-full truncate text-foreground leading-tight',
|
||||
!isNavigationV2 && 'max-w-[250px]'
|
||||
)}
|
||||
>
|
||||
{displayProjectName}
|
||||
return (
|
||||
<SidebarMenuButtonComponent
|
||||
ref={ref}
|
||||
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"
|
||||
{...buttonProps}
|
||||
>
|
||||
<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 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>
|
||||
</div>
|
||||
|
||||
<ChevronsUpDown
|
||||
strokeWidth={1.5}
|
||||
className="ml-auto text-foreground-lighter !w-4 !h-4 md:hidden md:group-hover:flex"
|
||||
/>
|
||||
</SidebarMenuButtonComponent>
|
||||
)
|
||||
})
|
||||
<ChevronsUpDown
|
||||
strokeWidth={1.5}
|
||||
className="ml-auto text-foreground-lighter !w-4 !h-4 md:hidden md:group-hover:flex"
|
||||
/>
|
||||
</SidebarMenuButtonComponent>
|
||||
)
|
||||
}
|
||||
)
|
||||
ProjectBranchSelectorTrigger.displayName = 'ProjectBranchSelectorTrigger'
|
||||
@@ -24,7 +24,7 @@ import { PausingState } from '../ProjectLayout/PausingState'
|
||||
import { ResizingState } from '../ProjectLayout/ResizingState'
|
||||
import RestartingState from '../ProjectLayout/RestartingState'
|
||||
import { RestoreFailedState } from '../ProjectLayout/RestoreFailedState'
|
||||
import RestoringState from '../ProjectLayout/RestoringState'
|
||||
import { RestoringState } from '../ProjectLayout/RestoringState'
|
||||
import { UpgradingState } from '../ProjectLayout/UpgradingState'
|
||||
|
||||
const routesToIgnoreProjectDetailsRequest = [
|
||||
|
||||
Reference in new issue
Block a user