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" />
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { PropsWithChildren } from 'react'
|
|
import { useAppStateSnapshot } from 'state/app-state'
|
|
import { cn } from 'ui'
|
|
|
|
interface Props {
|
|
title?: string
|
|
}
|
|
|
|
const MobileViewNav = ({ title }: PropsWithChildren<Props>) => {
|
|
const { mobileMenuOpen, setMobileMenuOpen } = useAppStateSnapshot()
|
|
|
|
return (
|
|
<nav
|
|
className={cn(
|
|
'group px-4 z-10 w-full h-10',
|
|
'border-b border-default',
|
|
'transition-width duration-200',
|
|
'flex md:hidden flex-row items-center gap-1 overflow-x-auto'
|
|
)}
|
|
>
|
|
<button
|
|
title="Menu dropdown button"
|
|
className={cn(
|
|
'group/view-toggle flex justify-center flex-col border-none space-x-0 items-start gap-1 !bg-transparent rounded-md min-w-[30px] w-[30px] h-[30px]'
|
|
)}
|
|
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
|
|
>
|
|
<div className="h-px inline-block left-0 w-4 transition-all ease-out bg-foreground-lighter group-hover/view-toggle:bg-foreground p-0 m-0" />
|
|
<div className="h-px inline-block left-0 w-3 transition-all ease-out bg-foreground-lighter group-hover/view-toggle:bg-foreground p-0 m-0" />
|
|
</button>
|
|
<div className="flex items-center">
|
|
<h4 className="text-base">{title}</h4>
|
|
</div>
|
|
</nav>
|
|
)
|
|
}
|
|
|
|
export default MobileViewNav
|