Skip to content

Commit 0ff0476

Browse files
committed
feat: top menu for mobile resolution with sheet menu
1 parent efc6c5f commit 0ff0476

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

src/components/layout/AppMenu.tsx

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
import { Menu } from "lucide-react";
2+
import { useState } from "react";
3+
14
import logo from "/Tangle_white.png";
25
import { isAuthorizationRequired } from "@/components/shared/Authentication/helpers";
36
import { TopBarAuthentication } from "@/components/shared/Authentication/TopBarAuthentication";
47
import { CopyText } from "@/components/shared/CopyText/CopyText";
58
import ImportPipeline from "@/components/shared/ImportPipeline";
6-
import { InlineStack } from "@/components/ui/layout";
9+
import { Button } from "@/components/ui/button";
10+
import { BlockStack, InlineStack } from "@/components/ui/layout";
711
import { Link } from "@/components/ui/link";
12+
import {
13+
Sheet,
14+
SheetContent,
15+
SheetHeader,
16+
SheetTitle,
17+
SheetTrigger,
18+
} from "@/components/ui/sheet";
819
import { useComponentSpec } from "@/providers/ComponentSpecProvider";
920
import { TOP_NAV_HEIGHT } from "@/utils/constants";
1021

@@ -17,6 +28,7 @@ const AppMenu = () => {
1728
const requiresAuthorization = isAuthorizationRequired();
1829
const { componentSpec } = useComponentSpec();
1930
const title = componentSpec?.name;
31+
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
2032

2133
return (
2234
<div
@@ -41,17 +53,46 @@ const AppMenu = () => {
4153
</InlineStack>
4254

4355
<InlineStack gap="2" wrap="nowrap" className="shrink-0">
44-
<InlineStack gap="2" className="md:flex" wrap="nowrap">
56+
{/* Desktop action buttons - hidden on mobile */}
57+
<InlineStack gap="2" className="hidden md:flex" wrap="nowrap">
4558
<CloneRunButton componentSpec={componentSpec} />
4659
<ImportPipeline />
4760
<NewPipelineButton />
4861
</InlineStack>
4962

63+
{/* Always visible settings */}
5064
<InlineStack gap="2" wrap="nowrap">
5165
<BackendStatus />
5266
<PersonalPreferences />
5367
{requiresAuthorization && <TopBarAuthentication />}
5468
</InlineStack>
69+
70+
{/* Mobile hamburger menu - visible only on mobile */}
71+
<Sheet open={mobileMenuOpen} onOpenChange={setMobileMenuOpen}>
72+
<SheetTrigger asChild>
73+
<Button
74+
variant="ghost"
75+
size="icon"
76+
className="md:hidden text-white hover:bg-stone-800"
77+
aria-label="Open menu"
78+
>
79+
<Menu className="h-5 w-5" />
80+
</Button>
81+
</SheetTrigger>
82+
<SheetContent
83+
side="right"
84+
className="w-fit bg-stone-900 border-stone-700 px-4"
85+
>
86+
<SheetHeader>
87+
<SheetTitle className="text-white">Actions</SheetTitle>
88+
</SheetHeader>
89+
<BlockStack gap="3" className="mt-6">
90+
<CloneRunButton componentSpec={componentSpec} />
91+
<ImportPipeline />
92+
<NewPipelineButton />
93+
</BlockStack>
94+
</SheetContent>
95+
</Sheet>
5596
</InlineStack>
5697
</InlineStack>
5798
</div>

0 commit comments

Comments
 (0)