11// ~~~~~~~~~~~~~~~ Imports ~~~~~~~~~~~~~~~ //
22import { registerRootComponent } from "expo" ;
3+ import { useEffect } from "react" ;
4+ import { Dimensions , Platform } from "react-native" ;
5+ import * as ScreenOrientation from "expo-screen-orientation" ;
36import "react-native-gesture-handler" ;
47import { NavigationContainer } from "@react-navigation/native" ;
58import "../global.css" ;
@@ -8,7 +11,7 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
811
912// ~~~~~~~~~~ Import translation ~~~~~~~~~ //
1013// Import i18next for localisation
11- import "./translations/TranslationConfig " ;
14+ import "./translations/translationConfig " ;
1215
1316// ~~~~~~~~~~ Import first stack ~~~~~~~~~ //
1417import LoadingStack from "./routes/LoadingStack" ;
@@ -17,7 +20,7 @@ import LoadingStack from "./routes/LoadingStack";
1720import { ThemeProvider } from "./provider/ThemeProvider" ;
1821
1922// ~~~~~~~~~~~ Service imports ~~~~~~~~~~~ //
20- import ApplyInterceptor from "./services/ApplyInterceptor " ;
23+ import ApplyInterceptor from "./services/applyInterceptor " ;
2124
2225// ====================================================== //
2326// ===================== Export App ===================== //
@@ -26,6 +29,21 @@ export default function App() {
2629 // Apply the interceptor
2730 ApplyInterceptor ( ) ;
2831
32+ useEffect ( ( ) => {
33+ const { height, width } = Dimensions . get ( "window" ) ;
34+ const isTablet =
35+ ( Platform . OS === "ios" && ( height > 800 || width > 800 ) ) ||
36+ ( Platform . OS === "android" && ( height > 800 || width > 800 ) ) ;
37+
38+ if ( isTablet ) {
39+ ScreenOrientation . unlockAsync ( ) ;
40+ } else {
41+ ScreenOrientation . lockAsync (
42+ ScreenOrientation . OrientationLock . PORTRAIT_UP ,
43+ ) ;
44+ }
45+ } , [ ] ) ;
46+
2947 // ====================================================== //
3048 // ================ Return App component ================ //
3149 // ====================================================== //
0 commit comments