mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 11:55:05 +03:00
This PR migrates the whole monorepo to use Tailwind v4: - Removed `@tailwindcss/container-queries` plugin since it's included by default in v4, - Bump all instances of Tailwind to v4. Made minimal changes to the shared config to remove non-supported features (`alpha` mentions), - Migrate all apps to be compatible with v4 configs, - Fix the `typography.css` import in 3 apps, - Add missing rules which were included by default in v3, - Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot of classes - Rename all misnamed classes according to https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all apps. --------- Co-authored-by: Jordi Enric <jordi.err@gmail.com>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { useBreakpoint } from 'common'
|
|
import { PanelLeftClose, PanelLeftOpen } from 'lucide-react'
|
|
import { cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
|
|
|
|
import { useAppStateSnapshot } from '@/state/app-state'
|
|
|
|
export function CollapseButton({ hideTabs }: { hideTabs: boolean }) {
|
|
const { showSidebar, setShowSidebar, mobileMenuOpen, setMobileMenuOpen } = useAppStateSnapshot()
|
|
const isMobile = useBreakpoint('md')
|
|
|
|
const handleToggle = () => {
|
|
if (isMobile) {
|
|
setMobileMenuOpen(!mobileMenuOpen)
|
|
} else {
|
|
setShowSidebar(!showSidebar)
|
|
}
|
|
}
|
|
|
|
return (
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<button
|
|
className={cn(
|
|
'hidden md:flex items-center justify-center w-10 h-(--header-height) hover:bg-surface-100 shrink-0',
|
|
!hideTabs && 'border-b border-b-default'
|
|
)}
|
|
onClick={handleToggle}
|
|
>
|
|
{showSidebar ? (
|
|
<PanelLeftClose
|
|
size={16}
|
|
strokeWidth={1.5}
|
|
className="text-foreground-lighter hover:text-foreground-light"
|
|
/>
|
|
) : (
|
|
<PanelLeftOpen
|
|
size={16}
|
|
strokeWidth={1.5}
|
|
className="text-foreground-lighter hover:text-foreground-light"
|
|
/>
|
|
)}
|
|
</button>
|
|
</TooltipTrigger>
|
|
<TooltipContent side="bottom">{showSidebar ? 'Collapse' : 'Expand'} sidebar</TooltipContent>
|
|
</Tooltip>
|
|
)
|
|
}
|