File tree Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 11import ExtensionPreview from "@/components/extension/extension-preview" ;
22import { EditorContext } from "@/components/providers/editor-context-provider" ;
3+ import { useScreenSize } from "@/lib/hooks/use-screen-size" ;
34import { useTabViewManager } from "@/lib/hooks/use-tab-view-manager" ;
45import { AppViewConfig } from "@/lib/types" ;
56import { Button } from "@heroui/react" ;
@@ -10,6 +11,7 @@ export default function AppExplorer() {
1011 const editorContext = useContext ( EditorContext ) ;
1112
1213 const { createAppViewInCanvasView } = useTabViewManager ( ) ;
14+ const { isLandscape } = useScreenSize ( ) ;
1315
1416 const extensions = editorContext ?. persistSettings ?. extensions ?? [ ] ;
1517
@@ -36,6 +38,13 @@ export default function AppExplorer() {
3638 recommendedWidth : ext . config . recommendedWidth ,
3739 } ;
3840 createAppViewInCanvasView ( config ) ;
41+ console . log ( "Is Landscape:" , isLandscape ) ;
42+ if ( ! isLandscape ) {
43+ editorContext ?. setEditorStates ( ( prev ) => ( {
44+ ...prev ,
45+ isSideMenuOpen : false ,
46+ } ) ) ;
47+ }
3948 } }
4049 />
4150 </ div >
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import Tabs from "@/components/misc/tabs";
44import ProjectSettingsModal from "@/components/modals/project-settings-modal" ;
55import { EditorContext } from "@/components/providers/editor-context-provider" ;
66import useExplorer from "@/lib/hooks/use-explorer" ;
7+ import { useScreenSize } from "@/lib/hooks/use-screen-size" ;
78import { isWeb } from "@/lib/platform-api/platform-checker" ;
89import { TabItem } from "@/lib/types" ;
910import { Button } from "@heroui/react" ;
1011import { AnimatePresence , motion } from "framer-motion" ;
1112import { useContext , useState } from "react" ;
12- import { useMediaQuery } from "react-responsive" ;
1313import FileSystemExplorer from "../../explorer/file-system/fs-explorer" ;
1414import Icon from "../../misc/icon" ;
1515
@@ -55,9 +55,7 @@ export default function NavSideMenu({
5555}
5656
5757function MenuPanel ( { children } : { children ?: React . ReactNode } ) {
58- const isLandscape = useMediaQuery ( {
59- query : "(min-width: 768px)" ,
60- } ) ;
58+ const { isLandscape } = useScreenSize ( ) ;
6159
6260 return (
6361 < >
Original file line number Diff line number Diff line change 1+ import { useMediaQuery } from "react-responsive" ;
2+
3+ export function useScreenSize ( ) {
4+ const isLandscape = useMediaQuery ( {
5+ query : "(min-width: 768px)" ,
6+ } ) ;
7+ return { isLandscape } ;
8+ }
Original file line number Diff line number Diff line change 1+ import { PlatformEnum } from "@/lib/types" ;
12import { Capacitor } from "@capacitor/core" ;
23import isElectron from "is-electron" ;
3- import { PlatformEnum } from "@/lib/types" ;
44
55export function getPlatform ( ) {
66 // Capacitor
Original file line number Diff line number Diff line change 88 "build" : " next build" ,
99 "lint" : " next lint" ,
1010 "start" : " serve ../build/next" ,
11- "dev-https" : " next dev --experimental-https"
11+ "dev-https" : " next dev --experimental-https"
1212 },
1313 "dependencies" : {
1414 "@capacitor-community/safe-area" : " ^7.0.0-alpha.1" ,
You can’t perform that action at this time.
0 commit comments