diff --git a/src/hooks/useAuth.tsx b/src/hooks/useAuth.tsx new file mode 100644 index 0000000..346cb66 --- /dev/null +++ b/src/hooks/useAuth.tsx @@ -0,0 +1,9 @@ +import { useContext } from 'react'; + +import { AuthContext } from '@contexts/AuthContext'; + +export function useAuth() { + const context = useContext(AuthContext); + + return context; +} diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 6ed94d5..72874f5 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -5,13 +5,13 @@ 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'; +import { useAuth } from '@hooks/useAuth'; export function Routes() { const theme = DefaultTheme; - const contextData = useContext(AuthContext); + const { user } = useAuth(); + console.debug(user); theme.colors.background = gluestackUIConfig.tokens.colors.gray700;