11import { useState } from "react" ;
22import { Chat } from "@/web/components/chat/index" ;
3+ import { ChatBottomSheet } from "@/web/components/chat/chat-bottom-sheet" ;
34import { ChatPanel } from "@/web/components/chat/side-panel-chat" ;
45import { CreateProjectDialog } from "@/web/components/create-project-dialog" ;
56import { MeshSidebar } from "@/web/components/sidebar" ;
@@ -8,6 +9,7 @@ import { MeshUserMenu } from "@/web/components/user-menu.tsx";
89import { useDecoChatOpen } from "@/web/hooks/use-deco-chat-open" ;
910import { usePreferences } from "@/web/hooks/use-preferences.ts" ;
1011import { useLocalStorage } from "@/web/hooks/use-local-storage" ;
12+ import { useIsMobile } from "@deco/ui/hooks/use-mobile.ts" ;
1113import RequiredAuthLayout from "@/web/layouts/required-auth-layout" ;
1214import { authClient } from "@/web/lib/auth-client" ;
1315import { 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