Ship Expo Router screens, seeded stores, and polished UX so auth, shop, checkout, prescriptions, loyalty, family, and account processes work end-to-end offline. Co-authored-by: Cursor <cursoragent@cursor.com>
50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import "./global.css";
|
|
import "@/lib/i18n";
|
|
import { useEffect } from "react";
|
|
import { Stack } from "expo-router";
|
|
import { StatusBar } from "expo-status-bar";
|
|
import { useFonts } from "expo-font";
|
|
import * as SplashScreen from "expo-splash-screen";
|
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
import { PlusJakartaSans_400Regular } from "@expo-google-fonts/plus-jakarta-sans/400Regular";
|
|
import { PlusJakartaSans_500Medium } from "@expo-google-fonts/plus-jakarta-sans/500Medium";
|
|
import { PlusJakartaSans_600SemiBold } from "@expo-google-fonts/plus-jakarta-sans/600SemiBold";
|
|
import { PlusJakartaSans_700Bold } from "@expo-google-fonts/plus-jakarta-sans/700Bold";
|
|
import { PlusJakartaSans_800ExtraBold } from "@expo-google-fonts/plus-jakarta-sans/800ExtraBold";
|
|
import { colors } from "@/lib/theme";
|
|
|
|
SplashScreen.preventAutoHideAsync().catch(() => {});
|
|
|
|
export default function RootLayout() {
|
|
const [fontsLoaded, fontError] = useFonts({
|
|
Jakarta_400Regular: PlusJakartaSans_400Regular,
|
|
Jakarta_500Medium: PlusJakartaSans_500Medium,
|
|
Jakarta_600SemiBold: PlusJakartaSans_600SemiBold,
|
|
Jakarta_700Bold: PlusJakartaSans_700Bold,
|
|
Jakarta_800ExtraBold: PlusJakartaSans_800ExtraBold,
|
|
});
|
|
|
|
const ready = fontsLoaded || !!fontError;
|
|
|
|
useEffect(() => {
|
|
if (ready) SplashScreen.hideAsync().catch(() => {});
|
|
}, [ready]);
|
|
|
|
if (!ready) return null;
|
|
|
|
return (
|
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
<SafeAreaProvider>
|
|
<StatusBar style="dark" />
|
|
<Stack
|
|
screenOptions={{
|
|
headerShown: false,
|
|
contentStyle: { backgroundColor: colors.page },
|
|
}}
|
|
/>
|
|
</SafeAreaProvider>
|
|
</GestureHandlerRootView>
|
|
);
|
|
}
|