diff --git a/app/Gemfile.lock b/app/Gemfile.lock index 6d8fcf190..70f7d78f6 100644 --- a/app/Gemfile.lock +++ b/app/Gemfile.lock @@ -25,7 +25,7 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.4.0) - aws-partitions (1.1168.0) + aws-partitions (1.1170.0) aws-sdk-core (3.233.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -46,7 +46,7 @@ GEM babosa (1.0.4) base64 (0.3.0) benchmark (0.4.1) - bigdecimal (3.2.3) + bigdecimal (3.3.0) claide (1.1.0) cocoapods (1.16.2) addressable (~> 2.8) @@ -225,14 +225,14 @@ GEM i18n (1.14.7) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.15.0) + json (2.15.1) jwt (2.10.2) base64 logger (1.7.0) mini_magick (4.13.2) mini_mime (1.1.5) mini_portile2 (2.8.9) - minitest (5.25.5) + minitest (5.26.0) molinillo (0.8.0) multi_json (1.17.0) multipart-post (2.4.1) diff --git a/app/src/components/NavBar/index.ts b/app/src/components/NavBar/index.ts index a06a14949..6f9dec8f5 100644 --- a/app/src/components/NavBar/index.ts +++ b/app/src/components/NavBar/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: BUSL-1.1 // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. +export { AadhaarNavBar } from '@/components/NavBar/AadhaarNavBar'; export { DefaultNavBar } from '@/components/NavBar/DefaultNavBar'; export { HomeNavBar } from '@/components/NavBar/HomeNavBar'; export { IdDetailsNavBar } from '@/components/NavBar/IdDetailsNavBar'; diff --git a/app/src/components/homeScreen/idCard.tsx b/app/src/components/homeScreen/idCard.tsx index b6b115ec4..b38a24c75 100644 --- a/app/src/components/homeScreen/idCard.tsx +++ b/app/src/components/homeScreen/idCard.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BUSL-1.1 // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. -import type { FC } from 'react'; +import React, { type FC } from 'react'; import { Dimensions } from 'react-native'; import { Separator, Text, XStack, YStack } from 'tamagui'; diff --git a/app/src/hooks/useModal.ts b/app/src/hooks/useModal.ts index 58198c96e..97aa6e0b5 100644 --- a/app/src/hooks/useModal.ts +++ b/app/src/hooks/useModal.ts @@ -5,7 +5,7 @@ import { useCallback, useRef, useState } from 'react'; import { useNavigation } from '@react-navigation/native'; -import type { ModalParams } from '@/screens/system/ModalScreen'; +import type { ModalParams } from '@/screens/app/ModalScreen'; import { getModalCallbacks, registerModalCallbacks, diff --git a/app/src/navigation/settings.ts b/app/src/navigation/account.ts similarity index 50% rename from app/src/navigation/settings.ts rename to app/src/navigation/account.ts index 2c7a60c6b..5ee1467ab 100644 --- a/app/src/navigation/settings.ts +++ b/app/src/navigation/account.ts @@ -4,44 +4,57 @@ import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; -import CloudBackupScreen from '@/screens/settings/CloudBackupScreen'; -import DocumentDataInfoScreen from '@/screens/settings/DocumentDataInfoScreen'; -import ManageDocumentsScreen from '@/screens/settings/ManageDocumentsScreen'; -import SettingsScreen from '@/screens/settings/SettingsScreen'; -import ShowRecoveryPhraseScreen from '@/screens/settings/ShowRecoveryPhraseScreen'; +import AccountRecoveryChoiceScreen from '@/screens/account/recovery/AccountRecoveryChoiceScreen'; +import AccountRecoveryScreen from '@/screens/account/recovery/AccountRecoveryScreen'; +import DocumentDataNotFoundScreen from '@/screens/account/recovery/DocumentDataNotFoundScreen'; +import RecoverWithPhraseScreen from '@/screens/account/recovery/RecoverWithPhraseScreen'; +import CloudBackupScreen from '@/screens/account/settings/CloudBackupScreen'; +import SettingsScreen from '@/screens/account/settings/SettingsScreen'; +import ShowRecoveryPhraseScreen from '@/screens/account/settings/ShowRecoveryPhraseScreen'; import { black, slate300, white } from '@/utils/colors'; -const settingsScreens = { - CloudBackupSettings: { - screen: CloudBackupScreen, +const accountScreens = { + AccountRecovery: { + screen: AccountRecoveryScreen, options: { - title: 'Cloud backup', + headerShown: false, + } as NativeStackNavigationOptions, + }, + AccountRecoveryChoice: { + screen: AccountRecoveryChoiceScreen, + options: { + headerShown: false, + } as NativeStackNavigationOptions, + }, + RecoverWithPhrase: { + screen: RecoverWithPhraseScreen, + options: { + headerTintColor: black, + title: 'Enter Recovery Phrase', headerStyle: { backgroundColor: black, }, headerTitleStyle: { color: slate300, }, + headerBackTitle: 'close', } as NativeStackNavigationOptions, }, - ManageDocuments: { - screen: ManageDocumentsScreen, + DocumentDataNotFound: { + screen: DocumentDataNotFoundScreen, options: { - title: 'Manage Documents', - headerStyle: { - backgroundColor: white, - }, - headerTitleStyle: { - color: black, - }, + headerShown: false, } as NativeStackNavigationOptions, }, - DocumentDataInfo: { - screen: DocumentDataInfoScreen, + CloudBackupSettings: { + screen: CloudBackupScreen, options: { - title: 'Document Data Info', + title: 'Cloud backup', headerStyle: { - backgroundColor: white, + backgroundColor: black, + }, + headerTitleStyle: { + color: slate300, }, } as NativeStackNavigationOptions, }, @@ -72,4 +85,4 @@ const settingsScreens = { }, }; -export default settingsScreens; +export default accountScreens; diff --git a/app/src/navigation/account.web.ts b/app/src/navigation/account.web.ts new file mode 100644 index 000000000..b535d29f1 --- /dev/null +++ b/app/src/navigation/account.web.ts @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. +// SPDX-License-Identifier: BUSL-1.1 +// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. + +import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; + +import SettingsScreen from '@/screens/account/settings/SettingsScreen'; +import { black, white } from '@/utils/colors'; + +const accountScreens = { + Settings: { + screen: SettingsScreen, + options: { + animation: 'slide_from_bottom', + title: 'Settings', + headerStyle: { + backgroundColor: white, + }, + headerTitleStyle: { + color: black, + }, + } as NativeStackNavigationOptions, + config: { + screens: {}, + }, + }, +}; + +export default accountScreens; diff --git a/app/src/navigation/system.tsx b/app/src/navigation/app.tsx similarity index 77% rename from app/src/navigation/system.tsx rename to app/src/navigation/app.tsx index d019933dd..8b501fc15 100644 --- a/app/src/navigation/system.tsx +++ b/app/src/navigation/app.tsx @@ -8,13 +8,13 @@ import type { NativeStackNavigationOptions } from '@react-navigation/native-stac import type { DocumentCategory } from '@selfxyz/common/utils/types'; -import DeferredLinkingInfoScreen from '@/screens/system/DeferredLinkingInfoScreen'; -import LaunchScreen from '@/screens/system/LaunchScreen'; -import LoadingScreen from '@/screens/system/Loading'; -import ModalScreen from '@/screens/system/ModalScreen'; -import SplashScreen from '@/screens/system/SplashScreen'; +import DeferredLinkingInfoScreen from '@/screens/app/DeferredLinkingInfoScreen'; +import LaunchScreen from '@/screens/app/LaunchScreen'; +import LoadingScreen from '@/screens/app/LoadingScreen'; +import ModalScreen from '@/screens/app/ModalScreen'; +import SplashScreen from '@/screens/app/SplashScreen'; -const systemScreens = { +const appScreens = { Launch: { screen: LaunchScreen, options: { @@ -56,4 +56,4 @@ const systemScreens = { }, }; -export default systemScreens; +export default appScreens; diff --git a/app/src/navigation/document.ts b/app/src/navigation/document.ts deleted file mode 100644 index 13406bcc0..000000000 --- a/app/src/navigation/document.ts +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. -// SPDX-License-Identifier: BUSL-1.1 -// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. - -import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; - -import ComingSoonScreen from '@/screens/document/ComingSoonScreen'; -import ConfirmBelongingScreen from '@/screens/document/ConfirmBelongingScreen'; -import CountryPickerScreen from '@/screens/document/CountryPickerScreen'; -import DocumentCameraScreen from '@/screens/document/DocumentCameraScreen'; -import DocumentCameraTroubleScreen from '@/screens/document/DocumentCameraTroubleScreen'; -import DocumentNFCMethodSelectionScreen from '@/screens/document/DocumentNFCMethodSelectionScreen'; -import DocumentNFCScanScreen from '@/screens/document/DocumentNFCScanScreen'; -import DocumentNFCTroubleScreen from '@/screens/document/DocumentNFCTroubleScreen'; -import DocumentOnboardingScreen from '@/screens/document/DocumentOnboardingScreen'; -import IDPickerScreen from '@/screens/document/IDPickerScreen'; - -const documentScreens = { - DocumentCamera: { - screen: DocumentCameraScreen, - options: { - headerShown: false, - animation: 'slide_from_bottom', - } as NativeStackNavigationOptions, - }, - DocumentCameraTrouble: { - screen: DocumentCameraTroubleScreen, - options: { - headerShown: false, - animation: 'slide_from_bottom', - presentation: 'modal', - } as NativeStackNavigationOptions, - }, - DocumentNFCScan: { - screen: DocumentNFCScanScreen, - options: { - headerShown: false, - animation: 'slide_from_bottom', - } as NativeStackNavigationOptions, - initialParams: { - passportNumber: '', - dateOfBirth: '', - dateOfExpiry: '', - }, - }, - DocumentNFCTrouble: { - screen: DocumentNFCTroubleScreen, - options: { - headerShown: false, - animation: 'slide_from_bottom', - presentation: 'modal', - } as NativeStackNavigationOptions, - }, - DocumentOnboarding: { - screen: DocumentOnboardingScreen, - options: { - animation: 'slide_from_bottom', - // presentation: 'modal' wanted to do this but seems to break stuff - headerShown: false, - } as NativeStackNavigationOptions, - }, - ComingSoon: { - screen: ComingSoonScreen, - options: { - headerShown: false, - } as NativeStackNavigationOptions, - initialParams: { - countryCode: null, - documentCategory: null, - }, - }, - DocumentNFCMethodSelection: { - screen: DocumentNFCMethodSelectionScreen, - options: { - headerShown: false, - animation: 'slide_from_bottom', - } as NativeStackNavigationOptions, - }, - CountryPicker: { - screen: CountryPickerScreen, - options: { - headerShown: false, - } as NativeStackNavigationOptions, - }, - IDPicker: { - screen: IDPickerScreen, - options: { - headerShown: false, - } as NativeStackNavigationOptions, - initialParams: { - countryCode: '', - documentTypes: [], - }, - }, - ConfirmBelonging: { - screen: ConfirmBelongingScreen, - options: { - headerShown: false, - } as NativeStackNavigationOptions, - }, -}; - -export default documentScreens; diff --git a/app/src/navigation/documents.ts b/app/src/navigation/documents.ts new file mode 100644 index 000000000..750eccf42 --- /dev/null +++ b/app/src/navigation/documents.ts @@ -0,0 +1,155 @@ +// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. +// SPDX-License-Identifier: BUSL-1.1 +// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. + +import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; + +import { AadhaarNavBar, IdDetailsNavBar } from '@/components/NavBar'; +import AadhaarUploadedSuccessScreen from '@/screens/documents/aadhaar/AadhaarUploadedSuccessScreen'; +import AadhaarUploadErrorScreen from '@/screens/documents/aadhaar/AadhaarUploadErrorScreen'; +import AadhaarUploadScreen from '@/screens/documents/aadhaar/AadhaarUploadScreen'; +import DocumentDataInfoScreen from '@/screens/documents/management/DocumentDataInfoScreen'; +import IdDetailsScreen from '@/screens/documents/management/IdDetailsScreen'; +import ManageDocumentsScreen from '@/screens/documents/management/ManageDocumentsScreen'; +import DocumentCameraScreen from '@/screens/documents/scanning/DocumentCameraScreen'; +import DocumentCameraTroubleScreen from '@/screens/documents/scanning/DocumentCameraTroubleScreen'; +import DocumentNFCMethodSelectionScreen from '@/screens/documents/scanning/DocumentNFCMethodSelectionScreen'; +import DocumentNFCScanScreen from '@/screens/documents/scanning/DocumentNFCScanScreen'; +import DocumentNFCTroubleScreen from '@/screens/documents/scanning/DocumentNFCTroubleScreen'; +import ConfirmBelongingScreen from '@/screens/documents/selection/ConfirmBelongingScreen'; +import CountryPickerScreen from '@/screens/documents/selection/CountryPickerScreen'; +import DocumentOnboardingScreen from '@/screens/documents/selection/DocumentOnboardingScreen'; +import IDPickerScreen from '@/screens/documents/selection/IDPickerScreen'; +import { black, white } from '@/utils/colors'; + +const documentsScreens = { + DocumentCamera: { + screen: DocumentCameraScreen, + options: { + headerShown: false, + animation: 'slide_from_bottom', + } as NativeStackNavigationOptions, + }, + DocumentCameraTrouble: { + screen: DocumentCameraTroubleScreen, + options: { + headerShown: false, + animation: 'slide_from_bottom', + presentation: 'modal', + } as NativeStackNavigationOptions, + }, + DocumentNFCScan: { + screen: DocumentNFCScanScreen, + options: { + headerShown: false, + animation: 'slide_from_bottom', + } as NativeStackNavigationOptions, + initialParams: { + passportNumber: '', + dateOfBirth: '', + dateOfExpiry: '', + }, + }, + DocumentNFCTrouble: { + screen: DocumentNFCTroubleScreen, + options: { + headerShown: false, + animation: 'slide_from_bottom', + presentation: 'modal', + } as NativeStackNavigationOptions, + }, + DocumentNFCMethodSelection: { + screen: DocumentNFCMethodSelectionScreen, + options: { + headerShown: false, + animation: 'slide_from_bottom', + } as NativeStackNavigationOptions, + }, + DocumentOnboarding: { + screen: DocumentOnboardingScreen, + options: { + animation: 'slide_from_bottom', + headerShown: false, + } as NativeStackNavigationOptions, + }, + CountryPicker: { + screen: CountryPickerScreen, + options: { + headerShown: false, + } as NativeStackNavigationOptions, + }, + IDPicker: { + screen: IDPickerScreen, + options: { + headerShown: false, + } as NativeStackNavigationOptions, + initialParams: { + countryCode: '', + documentTypes: [], + }, + }, + ConfirmBelonging: { + screen: ConfirmBelongingScreen, + options: { + headerShown: false, + } as NativeStackNavigationOptions, + }, + IdDetails: { + screen: IdDetailsScreen, + options: { + title: '', + header: IdDetailsNavBar, + headerBackVisible: false, + }, + }, + ManageDocuments: { + screen: ManageDocumentsScreen, + options: { + title: 'Manage Documents', + headerStyle: { + backgroundColor: white, + }, + headerTitleStyle: { + color: black, + }, + } as NativeStackNavigationOptions, + }, + DocumentDataInfo: { + screen: DocumentDataInfoScreen, + options: { + title: 'Document Data Info', + headerStyle: { + backgroundColor: white, + }, + } as NativeStackNavigationOptions, + }, + AadhaarUpload: { + screen: AadhaarUploadScreen, + options: { + title: 'AADHAAR REGISTRATION', + header: AadhaarNavBar, + headerBackVisible: false, + } as NativeStackNavigationOptions, + }, + AadhaarUploadSuccess: { + screen: AadhaarUploadedSuccessScreen, + options: { + title: 'AADHAAR REGISTRATION', + header: AadhaarNavBar, + headerBackVisible: false, + } as NativeStackNavigationOptions, + }, + AadhaarUploadError: { + screen: AadhaarUploadErrorScreen, + options: { + title: 'AADHAAR REGISTRATION', + header: AadhaarNavBar, + headerBackVisible: false, + } as NativeStackNavigationOptions, + initialParams: { + errorType: 'general', + }, + }, +}; + +export default documentsScreens; diff --git a/app/src/navigation/home.ts b/app/src/navigation/home.ts index dcedddebd..e8471cc6a 100644 --- a/app/src/navigation/home.ts +++ b/app/src/navigation/home.ts @@ -4,25 +4,12 @@ import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; -import { HomeNavBar, IdDetailsNavBar } from '@/components/NavBar'; -import { AadhaarNavBar } from '@/components/NavBar/AadhaarNavBar'; -import AadhaarUploadedSuccessScreen from '@/screens/document/aadhaar/AadhaarUploadedSuccessScreen'; -import AadhaarUploadErrorScreen from '@/screens/document/aadhaar/AadhaarUploadErrorScreen'; -import AadhaarUploadScreen from '@/screens/document/aadhaar/AadhaarUploadScreen'; -import DisclaimerScreen from '@/screens/home/DisclaimerScreen'; +import { HomeNavBar } from '@/components/NavBar'; import HomeScreen from '@/screens/home/HomeScreen'; -import IdDetailsScreen from '@/screens/home/IdDetailsScreen'; import ProofHistoryDetailScreen from '@/screens/home/ProofHistoryDetailScreen'; import ProofHistoryScreen from '@/screens/home/ProofHistoryScreen'; const homeScreens = { - Disclaimer: { - screen: DisclaimerScreen, - options: { - title: 'Disclaimer', - headerShown: false, - } as NativeStackNavigationOptions, - }, Home: { screen: HomeScreen, options: { @@ -44,41 +31,6 @@ const homeScreens = { title: 'Approval', }, }, - IdDetails: { - screen: IdDetailsScreen, - options: { - title: '', - header: IdDetailsNavBar, // Use custom header - headerBackVisible: false, // Hide default back button - }, - }, - AadhaarUpload: { - screen: AadhaarUploadScreen, - options: { - title: 'AADHAAR REGISTRATION', - header: AadhaarNavBar, - headerBackVisible: false, - } as NativeStackNavigationOptions, - }, - AadhaarUploadSuccess: { - screen: AadhaarUploadedSuccessScreen, - options: { - title: 'AADHAAR REGISTRATION', - header: AadhaarNavBar, - headerBackVisible: false, - } as NativeStackNavigationOptions, - }, - AadhaarUploadError: { - screen: AadhaarUploadErrorScreen, - options: { - title: 'AADHAAR REGISTRATION', - header: AadhaarNavBar, - headerBackVisible: false, - } as NativeStackNavigationOptions, - initialParams: { - errorType: 'general', - }, - }, }; export default homeScreens; diff --git a/app/src/navigation/index.tsx b/app/src/navigation/index.tsx index c91514daf..d2b72f97e 100644 --- a/app/src/navigation/index.tsx +++ b/app/src/navigation/index.tsx @@ -16,23 +16,25 @@ import { useSelfClient } from '@selfxyz/mobile-sdk-alpha'; import { DefaultNavBar } from '@/components/NavBar'; import AppLayout from '@/layouts/AppLayout'; +import accountScreens from '@/navigation/account'; +import appScreens from '@/navigation/app'; import devScreens from '@/navigation/devTools'; -import documentScreens from '@/navigation/document'; +import documentsScreens from '@/navigation/documents'; import homeScreens from '@/navigation/home'; -import proveScreens from '@/navigation/prove'; -import recoveryScreens from '@/navigation/recovery'; -import settingsScreens from '@/navigation/settings'; -import systemScreens from '@/navigation/system'; +import onboardingScreens from '@/navigation/onboarding'; +import sharedScreens from '@/navigation/shared'; +import verificationScreens from '@/navigation/verification'; import analytics from '@/utils/analytics'; import { setupUniversalLinkListenerInNavigation } from '@/utils/deeplinks'; export const navigationScreens = { - ...systemScreens, - ...documentScreens, + ...appScreens, + ...onboardingScreens, ...homeScreens, - ...proveScreens, - ...settingsScreens, - ...recoveryScreens, + ...documentsScreens, + ...verificationScreens, + ...accountScreens, + ...sharedScreens, ...devScreens, // allow in production for testing }; const AppNavigation = createNativeStackNavigator({ diff --git a/app/src/navigation/onboarding.ts b/app/src/navigation/onboarding.ts new file mode 100644 index 000000000..4c034a545 --- /dev/null +++ b/app/src/navigation/onboarding.ts @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. +// SPDX-License-Identifier: BUSL-1.1 +// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. + +import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; + +import AccountVerifiedSuccessScreen from '@/screens/onboarding/AccountVerifiedSuccessScreen'; +import DisclaimerScreen from '@/screens/onboarding/DisclaimerScreen'; +import SaveRecoveryPhraseScreen from '@/screens/onboarding/SaveRecoveryPhraseScreen'; + +const onboardingScreens = { + Disclaimer: { + screen: DisclaimerScreen, + options: { + title: 'Disclaimer', + headerShown: false, + } as NativeStackNavigationOptions, + }, + SaveRecoveryPhrase: { + screen: SaveRecoveryPhraseScreen, + options: { + headerShown: false, + animation: 'slide_from_bottom', + } as NativeStackNavigationOptions, + }, + AccountVerifiedSuccess: { + screen: AccountVerifiedSuccessScreen, + options: { + headerShown: false, + animation: 'slide_from_bottom', + } as NativeStackNavigationOptions, + }, +}; + +export default onboardingScreens; diff --git a/app/src/navigation/recovery.ts b/app/src/navigation/recovery.ts deleted file mode 100644 index 6e98ff2b0..000000000 --- a/app/src/navigation/recovery.ts +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. -// SPDX-License-Identifier: BUSL-1.1 -// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. - -import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; - -import AccountRecoveryChoiceScreen from '@/screens/recovery/AccountRecoveryChoiceScreen'; -import AccountRecoveryScreen from '@/screens/recovery/AccountRecoveryScreen'; -import AccountVerifiedSuccessScreen from '@/screens/recovery/AccountVerifiedSuccessScreen'; -import DocumentDataNotFound from '@/screens/recovery/DocumentDataNotFoundScreen'; -import RecoverWithPhraseScreen from '@/screens/recovery/RecoverWithPhraseScreen'; -import SaveRecoveryPhraseScreen from '@/screens/recovery/SaveRecoveryPhraseScreen'; -import { black, slate300 } from '@/utils/colors'; - -const recoveryScreens = { - AccountRecovery: { - screen: AccountRecoveryScreen, - options: { - headerShown: false, - } as NativeStackNavigationOptions, - }, - AccountRecoveryChoice: { - screen: AccountRecoveryChoiceScreen, - options: { - headerShown: false, - } as NativeStackNavigationOptions, - }, - AccountVerifiedSuccess: { - screen: AccountVerifiedSuccessScreen, - options: { - headerShown: false, - animation: 'slide_from_bottom', - } as NativeStackNavigationOptions, - }, - DocumentDataNotFound: { - screen: DocumentDataNotFound, - options: { - headerShown: false, - gestureEnabled: false, - animation: 'slide_from_bottom', - // presentation: 'modal', - } as NativeStackNavigationOptions, - }, - RecoverWithPhrase: { - screen: RecoverWithPhraseScreen, - options: { - headerTintColor: black, - title: 'Enter Recovery Phrase', - headerStyle: { - backgroundColor: black, - }, - headerTitleStyle: { - color: slate300, - }, - headerBackTitle: 'close', - } as NativeStackNavigationOptions, - }, - SaveRecoveryPhrase: { - screen: SaveRecoveryPhraseScreen, - options: { - headerShown: false, - animation: 'slide_from_bottom', - } as NativeStackNavigationOptions, - }, -}; - -export default recoveryScreens; diff --git a/app/src/navigation/settings.web.ts b/app/src/navigation/settings.web.ts deleted file mode 100644 index 2c192395a..000000000 --- a/app/src/navigation/settings.web.ts +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. -// SPDX-License-Identifier: BUSL-1.1 -// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. - -import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; - -import DocumentDataInfoScreen from '@/screens/settings/DocumentDataInfoScreen'; -import ManageDocumentsScreen from '@/screens/settings/ManageDocumentsScreen'; -import SettingsScreen from '@/screens/settings/SettingsScreen'; -import { black, white } from '@/utils/colors'; - -const settingsScreens = { - ManageDocuments: { - screen: ManageDocumentsScreen, - options: { - title: 'Manage Documents', - headerStyle: { - backgroundColor: white, - }, - headerTitleStyle: { - color: black, - }, - } as NativeStackNavigationOptions, - }, - DocumentDataInfo: { - screen: DocumentDataInfoScreen, - options: { - title: 'Document Data Info', - headerStyle: { - backgroundColor: white, - }, - } as NativeStackNavigationOptions, - }, - Settings: { - screen: SettingsScreen, - options: { - animation: 'slide_from_bottom', - title: 'Settings', - headerStyle: { - backgroundColor: white, - }, - headerTitleStyle: { - color: black, - }, - } as NativeStackNavigationOptions, - config: { - screens: {}, - }, - }, -}; - -export default settingsScreens; diff --git a/app/src/navigation/recovery.web.ts b/app/src/navigation/shared.ts similarity index 52% rename from app/src/navigation/recovery.web.ts rename to app/src/navigation/shared.ts index 211127c0a..e1defb90e 100644 --- a/app/src/navigation/recovery.web.ts +++ b/app/src/navigation/shared.ts @@ -4,18 +4,19 @@ import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; -import DocumentDataNotFound from '@/screens/recovery/DocumentDataNotFoundScreen'; +import ComingSoonScreen from '@/screens/shared/ComingSoonScreen'; -const recoveryScreens = { - DocumentDataNotFound: { - screen: DocumentDataNotFound, +const sharedScreens = { + ComingSoon: { + screen: ComingSoonScreen, options: { headerShown: false, - gestureEnabled: false, - animation: 'slide_from_bottom', - // presentation: 'modal', } as NativeStackNavigationOptions, + initialParams: { + countryCode: null, + documentCategory: null, + }, }, }; -export default recoveryScreens; +export default sharedScreens; diff --git a/app/src/navigation/prove.ts b/app/src/navigation/verification.ts similarity index 74% rename from app/src/navigation/prove.ts rename to app/src/navigation/verification.ts index e7e8bb94e..8feaeeb72 100644 --- a/app/src/navigation/prove.ts +++ b/app/src/navigation/verification.ts @@ -4,13 +4,13 @@ import type { NativeStackNavigationOptions } from '@react-navigation/native-stack'; -import ProofRequestStatusScreen from '@/screens/prove/ProofRequestStatusScreen'; -import ProveScreen from '@/screens/prove/ProveScreen'; -import QRCodeTroubleScreen from '@/screens/prove/QRCodeTroubleScreen'; -import QRCodeViewFinderScreen from '@/screens/prove/QRCodeViewFinderScreen'; +import ProofRequestStatusScreen from '@/screens/verification/ProofRequestStatusScreen'; +import ProveScreen from '@/screens/verification/ProveScreen'; +import QRCodeTroubleScreen from '@/screens/verification/QRCodeTroubleScreen'; +import QRCodeViewFinderScreen from '@/screens/verification/QRCodeViewFinderScreen'; import { black, white } from '@/utils/colors'; -const proveScreens = { +const verificationScreens = { ProofRequestStatus: { screen: ProofRequestStatusScreen, options: { @@ -43,9 +43,8 @@ const proveScreens = { options: { headerShown: false, animation: 'slide_from_bottom', - // presentation: 'modal', } as NativeStackNavigationOptions, }, }; -export default proveScreens; +export default verificationScreens; diff --git a/app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx b/app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx similarity index 100% rename from app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx rename to app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx diff --git a/app/src/screens/recovery/AccountRecoveryScreen.tsx b/app/src/screens/account/recovery/AccountRecoveryScreen.tsx similarity index 100% rename from app/src/screens/recovery/AccountRecoveryScreen.tsx rename to app/src/screens/account/recovery/AccountRecoveryScreen.tsx diff --git a/app/src/screens/recovery/DocumentDataNotFoundScreen.tsx b/app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx similarity index 100% rename from app/src/screens/recovery/DocumentDataNotFoundScreen.tsx rename to app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx diff --git a/app/src/screens/recovery/RecoverWithPhraseScreen.tsx b/app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx similarity index 100% rename from app/src/screens/recovery/RecoverWithPhraseScreen.tsx rename to app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx diff --git a/app/src/screens/settings/CloudBackupScreen.tsx b/app/src/screens/account/settings/CloudBackupScreen.tsx similarity index 100% rename from app/src/screens/settings/CloudBackupScreen.tsx rename to app/src/screens/account/settings/CloudBackupScreen.tsx diff --git a/app/src/screens/settings/SettingsScreen.tsx b/app/src/screens/account/settings/SettingsScreen.tsx similarity index 99% rename from app/src/screens/settings/SettingsScreen.tsx rename to app/src/screens/account/settings/SettingsScreen.tsx index 20b6e1af8..3d1b476d1 100644 --- a/app/src/screens/settings/SettingsScreen.tsx +++ b/app/src/screens/account/settings/SettingsScreen.tsx @@ -40,7 +40,7 @@ import { extraYPadding } from '@/utils/constants'; import { impactLight } from '@/utils/haptic'; import { getCountry, getLocales, getTimeZone } from '@/utils/locale'; -import { version } from '../../../package.json'; +import { version } from '../../../../package.json'; interface MenuButtonProps extends PropsWithChildren { Icon: React.FC; diff --git a/app/src/screens/settings/ShowRecoveryPhraseScreen.tsx b/app/src/screens/account/settings/ShowRecoveryPhraseScreen.tsx similarity index 100% rename from app/src/screens/settings/ShowRecoveryPhraseScreen.tsx rename to app/src/screens/account/settings/ShowRecoveryPhraseScreen.tsx diff --git a/app/src/screens/system/DeferredLinkingInfoScreen.tsx b/app/src/screens/app/DeferredLinkingInfoScreen.tsx similarity index 100% rename from app/src/screens/system/DeferredLinkingInfoScreen.tsx rename to app/src/screens/app/DeferredLinkingInfoScreen.tsx diff --git a/app/src/screens/system/LaunchScreen.tsx b/app/src/screens/app/LaunchScreen.tsx similarity index 100% rename from app/src/screens/system/LaunchScreen.tsx rename to app/src/screens/app/LaunchScreen.tsx diff --git a/app/src/screens/system/Loading.tsx b/app/src/screens/app/LoadingScreen.tsx similarity index 100% rename from app/src/screens/system/Loading.tsx rename to app/src/screens/app/LoadingScreen.tsx diff --git a/app/src/screens/system/ModalScreen.tsx b/app/src/screens/app/ModalScreen.tsx similarity index 100% rename from app/src/screens/system/ModalScreen.tsx rename to app/src/screens/app/ModalScreen.tsx diff --git a/app/src/screens/system/SplashScreen.tsx b/app/src/screens/app/SplashScreen.tsx similarity index 100% rename from app/src/screens/system/SplashScreen.tsx rename to app/src/screens/app/SplashScreen.tsx diff --git a/app/src/screens/document/aadhaar/AadhaarUploadErrorScreen.tsx b/app/src/screens/documents/aadhaar/AadhaarUploadErrorScreen.tsx similarity index 100% rename from app/src/screens/document/aadhaar/AadhaarUploadErrorScreen.tsx rename to app/src/screens/documents/aadhaar/AadhaarUploadErrorScreen.tsx diff --git a/app/src/screens/document/aadhaar/AadhaarUploadScreen.tsx b/app/src/screens/documents/aadhaar/AadhaarUploadScreen.tsx similarity index 100% rename from app/src/screens/document/aadhaar/AadhaarUploadScreen.tsx rename to app/src/screens/documents/aadhaar/AadhaarUploadScreen.tsx diff --git a/app/src/screens/document/aadhaar/AadhaarUploadedSuccessScreen.tsx b/app/src/screens/documents/aadhaar/AadhaarUploadedSuccessScreen.tsx similarity index 100% rename from app/src/screens/document/aadhaar/AadhaarUploadedSuccessScreen.tsx rename to app/src/screens/documents/aadhaar/AadhaarUploadedSuccessScreen.tsx diff --git a/app/src/screens/settings/DocumentDataInfoScreen.tsx b/app/src/screens/documents/management/DocumentDataInfoScreen.tsx similarity index 100% rename from app/src/screens/settings/DocumentDataInfoScreen.tsx rename to app/src/screens/documents/management/DocumentDataInfoScreen.tsx diff --git a/app/src/screens/home/IdDetailsScreen.tsx b/app/src/screens/documents/management/IdDetailsScreen.tsx similarity index 100% rename from app/src/screens/home/IdDetailsScreen.tsx rename to app/src/screens/documents/management/IdDetailsScreen.tsx diff --git a/app/src/screens/settings/ManageDocumentsScreen.tsx b/app/src/screens/documents/management/ManageDocumentsScreen.tsx similarity index 100% rename from app/src/screens/settings/ManageDocumentsScreen.tsx rename to app/src/screens/documents/management/ManageDocumentsScreen.tsx diff --git a/app/src/screens/document/DocumentCameraScreen.tsx b/app/src/screens/documents/scanning/DocumentCameraScreen.tsx similarity index 100% rename from app/src/screens/document/DocumentCameraScreen.tsx rename to app/src/screens/documents/scanning/DocumentCameraScreen.tsx diff --git a/app/src/screens/document/DocumentCameraTroubleScreen.tsx b/app/src/screens/documents/scanning/DocumentCameraTroubleScreen.tsx similarity index 100% rename from app/src/screens/document/DocumentCameraTroubleScreen.tsx rename to app/src/screens/documents/scanning/DocumentCameraTroubleScreen.tsx diff --git a/app/src/screens/document/DocumentNFCMethodSelectionScreen.tsx b/app/src/screens/documents/scanning/DocumentNFCMethodSelectionScreen.tsx similarity index 100% rename from app/src/screens/document/DocumentNFCMethodSelectionScreen.tsx rename to app/src/screens/documents/scanning/DocumentNFCMethodSelectionScreen.tsx diff --git a/app/src/screens/document/DocumentNFCScanScreen.tsx b/app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx similarity index 100% rename from app/src/screens/document/DocumentNFCScanScreen.tsx rename to app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx diff --git a/app/src/screens/document/DocumentNFCScanScreen.web.tsx b/app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx similarity index 100% rename from app/src/screens/document/DocumentNFCScanScreen.web.tsx rename to app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx diff --git a/app/src/screens/document/DocumentNFCTroubleScreen.tsx b/app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx similarity index 100% rename from app/src/screens/document/DocumentNFCTroubleScreen.tsx rename to app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx diff --git a/app/src/screens/document/ConfirmBelongingScreen.tsx b/app/src/screens/documents/selection/ConfirmBelongingScreen.tsx similarity index 98% rename from app/src/screens/document/ConfirmBelongingScreen.tsx rename to app/src/screens/documents/selection/ConfirmBelongingScreen.tsx index 1013b9814..734731fec 100644 --- a/app/src/screens/document/ConfirmBelongingScreen.tsx +++ b/app/src/screens/documents/selection/ConfirmBelongingScreen.tsx @@ -21,7 +21,7 @@ import Description from '@/components/typography/Description'; import { Title } from '@/components/typography/Title'; import useHapticNavigation from '@/hooks/useHapticNavigation'; import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout'; -import { styles } from '@/screens/prove/ProofRequestStatusScreen'; +import { styles } from '@/screens/verification/ProofRequestStatusScreen'; import { useSettingStore } from '@/stores/settingStore'; import { flushAllAnalytics, trackNfcEvent } from '@/utils/analytics'; import { black, white } from '@/utils/colors'; diff --git a/app/src/screens/document/CountryPickerScreen.tsx b/app/src/screens/documents/selection/CountryPickerScreen.tsx similarity index 100% rename from app/src/screens/document/CountryPickerScreen.tsx rename to app/src/screens/documents/selection/CountryPickerScreen.tsx diff --git a/app/src/screens/document/DocumentOnboardingScreen.tsx b/app/src/screens/documents/selection/DocumentOnboardingScreen.tsx similarity index 100% rename from app/src/screens/document/DocumentOnboardingScreen.tsx rename to app/src/screens/documents/selection/DocumentOnboardingScreen.tsx diff --git a/app/src/screens/document/IDPickerScreen.tsx b/app/src/screens/documents/selection/IDPickerScreen.tsx similarity index 100% rename from app/src/screens/document/IDPickerScreen.tsx rename to app/src/screens/documents/selection/IDPickerScreen.tsx diff --git a/app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx b/app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx similarity index 96% rename from app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx rename to app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx index 52b8fca37..5e81b0c7b 100644 --- a/app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx +++ b/app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx @@ -14,7 +14,7 @@ import { DelayedLottieView } from '@/components/DelayedLottieView'; import Description from '@/components/typography/Description'; import { Title } from '@/components/typography/Title'; import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout'; -import { styles } from '@/screens/prove/ProofRequestStatusScreen'; +import { styles } from '@/screens/verification/ProofRequestStatusScreen'; import { black, white } from '@/utils/colors'; import { buttonTap } from '@/utils/haptic'; diff --git a/app/src/screens/home/DisclaimerScreen.tsx b/app/src/screens/onboarding/DisclaimerScreen.tsx similarity index 100% rename from app/src/screens/home/DisclaimerScreen.tsx rename to app/src/screens/onboarding/DisclaimerScreen.tsx diff --git a/app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx b/app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx similarity index 100% rename from app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx rename to app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx diff --git a/app/src/screens/document/ComingSoonScreen.tsx b/app/src/screens/shared/ComingSoonScreen.tsx similarity index 100% rename from app/src/screens/document/ComingSoonScreen.tsx rename to app/src/screens/shared/ComingSoonScreen.tsx diff --git a/app/src/screens/prove/ProofRequestStatusScreen.tsx b/app/src/screens/verification/ProofRequestStatusScreen.tsx similarity index 100% rename from app/src/screens/prove/ProofRequestStatusScreen.tsx rename to app/src/screens/verification/ProofRequestStatusScreen.tsx diff --git a/app/src/screens/prove/ProveScreen.tsx b/app/src/screens/verification/ProveScreen.tsx similarity index 100% rename from app/src/screens/prove/ProveScreen.tsx rename to app/src/screens/verification/ProveScreen.tsx diff --git a/app/src/screens/prove/QRCodeTroubleScreen.tsx b/app/src/screens/verification/QRCodeTroubleScreen.tsx similarity index 100% rename from app/src/screens/prove/QRCodeTroubleScreen.tsx rename to app/src/screens/verification/QRCodeTroubleScreen.tsx diff --git a/app/src/screens/prove/QRCodeViewFinderScreen.tsx b/app/src/screens/verification/QRCodeViewFinderScreen.tsx similarity index 100% rename from app/src/screens/prove/QRCodeViewFinderScreen.tsx rename to app/src/screens/verification/QRCodeViewFinderScreen.tsx diff --git a/app/tsconfig.json b/app/tsconfig.json index 1da1335af..50d64a664 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -10,6 +10,7 @@ "skipDefaultLibCheck": false, "paths": { "@env": ["./env.ts"], + "@/package.json": ["./package.json"], "@selfxyz/mobile-sdk-alpha": [ "../packages/mobile-sdk-alpha/src", "../packages/mobile-sdk-alpha/dist" diff --git a/app/vite.config.ts b/app/vite.config.ts index 5425c4cd9..c9650356e 100644 --- a/app/vite.config.ts +++ b/app/vite.config.ts @@ -32,6 +32,7 @@ export default defineConfig({ '@env': resolve(__dirname, 'env.ts'), '/src': resolve(__dirname, 'src'), '@': resolve(__dirname, 'src'), + '@/package.json': resolve(__dirname, 'package.json'), 'react-native-svg': 'react-native-svg-web', 'lottie-react-native': 'lottie-react', '@react-native-community/blur': resolve( @@ -173,11 +174,11 @@ export default defineConfig({ 'vendor-state-zustand': ['zustand'], // Screen-specific chunks - more granular - 'screens-document-core': ['./src/navigation/document.ts'], + 'screens-document-core': ['./src/navigation/documents.ts'], 'screens-passport-nfc': ['./src/utils/nfcScanner.ts'], // Proving - split into even smaller chunks - 'screens-prove-core': ['./src/navigation/prove.ts'], + 'screens-prove-core': ['./src/navigation/verification.ts'], 'screens-prove-validation-core': [ './src/utils/proving/validateDocument.ts', ], @@ -192,8 +193,7 @@ export default defineConfig({ ], // Other screens - 'screens-settings': ['./src/navigation/settings.ts'], - 'screens-recovery': ['./src/navigation/recovery.ts'], + 'screens-settings': ['./src/navigation/account.ts'], 'screens-dev': ['./src/navigation/devTools.ts'], }, },