diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index f16d2a3e..10b5a0f2 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -12,8 +12,10 @@ import { } from '@expo-google-fonts/be-vietnam-pro' import { Stack } from 'expo-router' import * as SplashScreen from 'expo-splash-screen' +import * as WebBrowser from "expo-web-browser"; import 'react-native-reanimated' +import { useWarmUpBrowser } from '@/hooks/use-warm-up-browser' import { useColorScheme } from '@/hooks/useColorScheme' import { queryClient } from '@/lib/client' import { @@ -36,12 +38,15 @@ cssInterop(Svg, { // Prevent the splash screen from auto-hiding before asset loading is complete. SplashScreen.preventAutoHideAsync() +WebBrowser.maybeCompleteAuthSession(); + // biome-ignore lint/style/useNamingConvention: export const unstable_settings = { initialRouteName: '(app)', } export default function RootLayout() { + useWarmUpBrowser(); const colorScheme = useColorScheme() const [fontsLoaded] = useFonts({ BeVietnamPro_300Light, diff --git a/apps/mobile/components/auth/auth-social.tsx b/apps/mobile/components/auth/auth-social.tsx index 35cbd534..ee04f5ec 100644 --- a/apps/mobile/components/auth/auth-social.tsx +++ b/apps/mobile/components/auth/auth-social.tsx @@ -1,3 +1,4 @@ +import { useOAuth } from '@clerk/clerk-expo' import type { SvgProps } from 'react-native-svg' import { Button } from '../Button' import { AppleLogo } from '../svg-assets/apple-logo' @@ -6,35 +7,63 @@ import { GoogleLogo } from '../svg-assets/google-logo' type AuthSocialProps = { label: string icon: React.ComponentType + onPress?: () => void } -export function AuthSocial({ - label, - icon: Icon, -}: AuthSocialProps) { +export function AuthSocial({ label, icon: Icon, onPress }: AuthSocialProps) { return ( -