diff --git a/App.tsx b/App.tsx index d8fa01c..da09be5 100644 --- a/App.tsx +++ b/App.tsx @@ -4,6 +4,8 @@ import { GluestackUIProvider } from '@gluestack-ui/themed'; import { config } from './config/gluestack-ui.config'; +import { AuthContext } from '@contexts/AuthContext'; + import { Loading } from '@components/Loading'; import { Routes } from '@routes/index'; @@ -15,16 +17,16 @@ export default function App() { return ( - {fontsLoaded ? ( - - ) : ( - - )} - + + {fontsLoaded ? : } + + ); } diff --git a/src/contexts/AuthContext.tsx b/src/contexts/AuthContext.tsx new file mode 100644 index 0000000..426cf75 --- /dev/null +++ b/src/contexts/AuthContext.tsx @@ -0,0 +1,3 @@ +import { createContext } from 'react'; + +export const AuthContext = createContext({}); diff --git a/src/routes/index.tsx b/src/routes/index.tsx index ec4ea50..6ed94d5 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -1,13 +1,18 @@ +import { useContext } from 'react'; import { DefaultTheme, NavigationContainer } from '@react-navigation/native'; import { Box } from '@gluestack-ui/themed'; import { AuthRoutes } from './auth.routes'; import { AppRoutes } from './app.routes'; +import { AuthContext } from '@contexts/AuthContext'; + import { gluestackUIConfig } from '../../config/gluestack-ui.config'; export function Routes() { const theme = DefaultTheme; + const contextData = useContext(AuthContext); + theme.colors.background = gluestackUIConfig.tokens.colors.gray700; return (