import type { RootScreenProps } from '@/Navigation/types'; import { useQuery } from '@tanstack/react-query'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { ActivityIndicator, Text, View } from 'react-native'; import { Paths } from '@/navigation/paths'; import { useTheme } from '@/theme'; import { AssetByVariant } from '@/components/atoms'; import { SafeScreen } from '@/components/templates'; function Startup({ navigation }: RootScreenProps) { const { fonts, gutters, layout } = useTheme(); const { t } = useTranslation(); const { isError, isFetching, isSuccess } = useQuery({ queryFn: () => { return Promise.resolve(true); }, queryKey: ['startup'], }); useEffect(() => { if (isSuccess) { navigation.reset({ index: 0, routes: [{ name: Paths.Example }], }); } }, [isSuccess, navigation]); return ( {isFetching ? ( ) : undefined} {isError ? ( {t('common_error')} ) : undefined} ); } export default Startup;