import { SplashScreen, Stack } from "expo-router";
import { useFonts } from "expo-font";
import { useEffect } from "react";
// import * as SplashScreen from "expo-splash-screen";
import "./global.css";
import GlobalProvider from "@/lib/globalProvider";

export default function RootLayout() {
  const [fontLoaded] = useFonts({
    spaceMono: require("../assets/fonts/Rubik-Bold.ttf"),
  });

  useEffect(() => {
    if (fontLoaded) {
      SplashScreen.hideAsync();
    }
  }, [fontLoaded]);

  if (!fontLoaded) {
    return null;
  }

  return(
  <GlobalProvider>
  <Stack screenOptions={{headerShown: false}}/>;
  </GlobalProvider>
  )
}
