diff --git a/App.js b/App.js index f2bda52..f896111 100644 --- a/App.js +++ b/App.js @@ -1,32 +1,29 @@ -import React, { - useState, - useCallback, - useEffect, - setGlobal, - useGlobal, -} from "reactn"; -import { GestureHandlerRootView } from "react-native-gesture-handler"; +import "@expo/metro-runtime"; +import { PortalProvider } from "@gorhom/portal"; +import { DefaultTheme, NavigationContainer } from "@react-navigation/native"; import { useFonts } from "expo-font"; import * as SplashScreen from "expo-splash-screen"; import { StatusBar } from "expo-status-bar"; -import { Platform } from "react-native"; -import { NavigationContainer, DefaultTheme } from "@react-navigation/native"; import moment from "moment"; import "moment/locale/fr"; -import "@expo/metro-runtime"; -import { PortalProvider } from "@gorhom/portal"; +import { Platform } from "react-native"; +import { GestureHandlerRootView } from "react-native-gesture-handler"; +import React, { + setGlobal, + useCallback, + useEffect, + useGlobal, + useState, +} from "reactn"; import { MainStack, Routes } from "./src/navigation"; import { Palette } from "./src/styles"; import { navigationRef, reset } from "./src/navigation/NavigationService"; -import initialGlobalState from "./src/config/initialGlobalState"; import { MenuProvider } from "react-native-popup-menu"; +import initialGlobalState from "./src/config/initialGlobalState"; -import firebase from "./src/config/firebase"; -import Providers from "./src/providers"; -import AppLayout from "./src/layouts/AppLayout"; import { Inter_400Regular, Inter_400Regular_Italic, @@ -34,10 +31,12 @@ import { Inter_600SemiBold, Inter_700Bold, } from "@expo-google-fonts/inter"; +import firebase from "./src/config/firebase"; +import Providers from "./src/providers"; -import "./src/utils/Sheet"; -import {LogBox} from "react-native"; +import { LogBox } from "react-native"; import CommentsBottomSheet from "./src/components/bottomsheets/CommentsBottomSheet"; +import "./src/utils/Sheet"; console.disableYellowBox = true; console.reportErrorsAsExceptions = false; @@ -120,32 +119,41 @@ const App = () => { - - - options?.title - ? `${options?.title} - minuit.starter` - : "minuit.starter", - }} - > - - - - + {/* */} + + options?.title + ? `${options?.title} - minuit.starter` + : "minuit.starter", + }} + > + + + + {/* */} diff --git a/src/layouts/AppLayout.js b/src/layouts/AppLayout.js deleted file mode 100644 index a04586a..0000000 --- a/src/layouts/AppLayout.js +++ /dev/null @@ -1,86 +0,0 @@ -import { Image, View } from "react-native"; -import { useGlobal } from "reactn"; - -import useLayoutType from "../hooks/useLayoutType"; - -import { background as backgrounds } from "../assets"; -import { Style } from "../styles"; - -// eslint-disable-next-line react/display-name -export default ({ currentUID = null, children }) => { - const { isWeb = false } = useLayoutType(); - - // Web: full-screen background with a centered content area (30% width) - const [webBackgroundImg] = useGlobal("webBackgroundImg"); - const [webLayoutMode] = useGlobal("webLayoutMode"); - - if (isWeb) { - return ( - - {/* Full-viewport background for web */} - - - {/* Centered content column (phone-like width) */} - - {children} - - - ); - } - - // Native / non-web: original layout - const sharedPanelStyle = {}; - return ( - - - {children} - - - ); -}; diff --git a/src/layouts/Page.js b/src/layouts/Page.js index 0d94adc..2f4d032 100644 --- a/src/layouts/Page.js +++ b/src/layouts/Page.js @@ -1,18 +1,17 @@ /* eslint-disable react/display-name */ -import { Alert, Image, Pressable, Text, View, Platform } from "react-native"; +import { Image, View } from "react-native"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import { SafeAreaView } from "react-native-safe-area-context"; -import React, { setGlobal, useEffect } from "reactn"; +import React from "reactn"; + import { responsiveHeight } from "../actions/responsiveSizes.js"; -import { gutters, Palette } from "../styles"; import BaseHeader from "../components/BaseHeader"; import NavigateHeader from "../components/NavigateHeader"; -import { background, icons } from "../assets"; -import { isDesktop, isWeb } from "../hooks/useLayoutType.js"; -import { useUserData } from "../providers/UserDataProvider.js"; -import { BlurView } from "expo-blur"; -import { FONT_FAMILY } from "../styles/Fonts"; -import ShareBtnWeb from "../components/ShareBtnWeb"; +import { gutters } from "../styles"; + +import { background } from "../assets/index.js"; +import { isWeb } from "../hooks/useLayoutType.js"; +// import { useUserData } from "../providers/UserDataProvider.js"; export default ({ children, @@ -36,32 +35,38 @@ export default ({ backgroundImg = background.writingBG, headerTitleStyle = {}, hideBackButton = false, - shareBtn = false, + width = undefined, }) => { - const { currentUID } = useUserData(); + // const { currentUID } = useUserData(); const PageContainer = containerType === "SAFE_AREA_VIEW" ? SafeAreaView : View; const ContentContainer = scrollEnabled ? KeyboardAwareScrollView : View; - // On web, push the background image to a global so AppLayout can render - // a full-screen background behind the phone frame. We avoid rendering - // the per-screen background inside the phone on web to prevent duplication. - useEffect(() => { - if (isWeb && backgroundImg) { - setGlobal({ webBackgroundImg: backgroundImg }); - } - }, [isWeb, backgroundImg]); + const handleScroll = () => {}; + + const computedWidth = width ?? (isWeb ? "60%" : "100%"); return ( - <> - {!isWeb && ( - - )} + + @@ -109,9 +113,6 @@ export default ({ {bottomStickyContent?.()} - {shareBtn && ( - - )} - + ); };