Skip to content

Commit 7d6d095

Browse files
committed
feat(mobile): add mobile branch to ShellLayoutInner with ChatBottomSheet
1 parent 3d0c180 commit 7d6d095

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

apps/mesh/src/web/layouts/shell-layout.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from "react";
22
import { Chat } from "@/web/components/chat/index";
3+
import { ChatBottomSheet } from "@/web/components/chat/chat-bottom-sheet";
34
import { ChatPanel } from "@/web/components/chat/side-panel-chat";
45
import { CreateProjectDialog } from "@/web/components/create-project-dialog";
56
import { MeshSidebar } from "@/web/components/sidebar";
@@ -8,6 +9,7 @@ import { MeshUserMenu } from "@/web/components/user-menu.tsx";
89
import { useDecoChatOpen } from "@/web/hooks/use-deco-chat-open";
910
import { usePreferences } from "@/web/hooks/use-preferences.ts";
1011
import { useLocalStorage } from "@/web/hooks/use-local-storage";
12+
import { useIsMobile } from "@deco/ui/hooks/use-mobile.ts";
1113
import RequiredAuthLayout from "@/web/layouts/required-auth-layout";
1214
import { authClient } from "@/web/lib/auth-client";
1315
import { LOCALSTORAGE_KEYS } from "@/web/lib/localstorage-keys";
@@ -93,6 +95,41 @@ function ShellLayoutInner({
9395
30,
9496
);
9597
const [preferences] = usePreferences();
98+
const isMobile = useIsMobile();
99+
100+
if (isMobile) {
101+
return (
102+
<SidebarLayout
103+
className="flex-1 bg-sidebar"
104+
data-studio={
105+
isStudio && preferences.experimental_projects ? "" : undefined
106+
}
107+
style={
108+
{
109+
"--sidebar-width": "13.5rem",
110+
"--sidebar-width-mobile": "11rem",
111+
} as Record<string, string>
112+
}
113+
>
114+
<MeshSidebar onCreateProject={onCreateProject} />
115+
<SidebarInset
116+
className="pt-1.5 flex flex-col flex-1 min-h-0"
117+
style={{ background: "transparent" }}
118+
>
119+
<div
120+
className={cn(
121+
"flex flex-col flex-1 min-h-0 bg-card overflow-hidden",
122+
"border-t border-l border-r border-sidebar-border",
123+
"rounded-tl-[0.75rem] rounded-tr-[0.75rem]",
124+
)}
125+
>
126+
<Outlet />
127+
</div>
128+
</SidebarInset>
129+
{!isHomeRoute && <ChatBottomSheet />}
130+
</SidebarLayout>
131+
);
132+
}
96133

97134
return (
98135
<SidebarLayout

0 commit comments

Comments
 (0)