mirror of
https://github.com/selfxyz/self.git
synced 2026-02-19 02:24:25 -05:00
* Sumsub: Update keychain and types * sumsub: ProvingMachine changes - WIP * fix: remove duplicate identifier * update proving machine * Refactor && Continue onchain registration if user left the app * fix register flow * Add hooks to KycSuccessScreen * Integrate KycVerifiedScreen (#1686) * Integrate KycVerifiedScreen & Fix race conditions * yarn lint * lint * lint * add mock kyc * fix disclose flow * yarn lint * Feat/add kyc home screen card design (#1708) * feat: add new designs to the kycIdCard * refactor: Update KycIdCard design to match IdCard styling * feat: update document cards + dev document * feat: update empty id card for new design * feat: update pending document card design * feat: update expired doc + unregistered doc cards from new design * fix: unregisted id card button links to continue registration screen * fix: logo design on document cards * feat: add 6 different backgrounds for ids deterministically shows 1 of 6 backgrounds for each document | fix: fixed document designs not displaying correctly. * chore: trigger CI rebuild * feat: Integrate PendingIdCard to Homescreen * fix KycIdCard.tsx --------- Co-authored-by: seshanthS <seshanth@protonmail.com> * lint * fix tests * fix: cleanup only on unmount * coderabbit comments * fix: cleanup unused code * fix: edge case for German Passports with D<< nationality code * fix tests * review comments * review comments * lint * Hide duplicated cards in Homescreen * remove console.log * fix patch * remove unused vars * agent updates * agent feedback * abstract colors and formatting * agent feedback * Regenerate Sumsub patch-package patch * fix: handle malformed kyc payload in card background selector * re-add for clean up --------- Co-authored-by: Evi Nova <66773372+Tranquil-Flow@users.noreply.github.com> Co-authored-by: Evi Nova <tranquil_flow@protonmail.com> Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz>
120 lines
4.2 KiB
TypeScript
120 lines
4.2 KiB
TypeScript
// 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 React from 'react';
|
|
import { ScrollView } from 'react-native';
|
|
import { YStack } from 'tamagui';
|
|
import { useNavigation } from '@react-navigation/native';
|
|
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
|
|
import { useSafeBottomPadding } from '@selfxyz/mobile-sdk-alpha/hooks';
|
|
|
|
import BugIcon from '@/assets/icons/bug_icon.svg';
|
|
import ErrorBoundary from '@/components/ErrorBoundary';
|
|
import type { RootStackParamList } from '@/navigation';
|
|
import { ErrorInjectionSelector } from '@/screens/dev/components/ErrorInjectionSelector';
|
|
import { LogLevelSelector } from '@/screens/dev/components/LogLevelSelector';
|
|
import { ParameterSection } from '@/screens/dev/components/ParameterSection';
|
|
import { useDangerZoneActions } from '@/screens/dev/hooks/useDangerZoneActions';
|
|
import { useNotificationHandlers } from '@/screens/dev/hooks/useNotificationHandlers';
|
|
import {
|
|
DangerZoneSection,
|
|
DebugShortcutsSection,
|
|
DevTogglesSection,
|
|
PushNotificationsSection,
|
|
} from '@/screens/dev/sections';
|
|
import { useSettingStore } from '@/stores/settingStore';
|
|
import { IS_DEV_MODE } from '@/utils/devUtils';
|
|
|
|
const DevSettingsScreen: React.FC = () => {
|
|
const navigation =
|
|
useNavigation() as NativeStackScreenProps<RootStackParamList>['navigation'];
|
|
const paddingBottom = useSafeBottomPadding(20);
|
|
|
|
// Settings store
|
|
const loggingSeverity = useSettingStore(state => state.loggingSeverity);
|
|
const setLoggingSeverity = useSettingStore(state => state.setLoggingSeverity);
|
|
const useStrongBox = useSettingStore(state => state.useStrongBox);
|
|
const setUseStrongBox = useSettingStore(state => state.setUseStrongBox);
|
|
const kycEnabled = useSettingStore(state => state.kycEnabled);
|
|
const setKycEnabled = useSettingStore(state => state.setKycEnabled);
|
|
|
|
// Custom hooks
|
|
const { hasNotificationPermission, subscribedTopics, handleTopicToggle } =
|
|
useNotificationHandlers();
|
|
const {
|
|
handleClearSecretsPress,
|
|
handleClearDocumentCatalogPress,
|
|
handleClearPointEventsPress,
|
|
handleResetBackupStatePress,
|
|
handleClearBackupEventsPress,
|
|
handleClearPendingVerificationsPress,
|
|
} = useDangerZoneActions();
|
|
|
|
return (
|
|
<ErrorBoundary>
|
|
<ScrollView showsVerticalScrollIndicator={false}>
|
|
<YStack
|
|
gap="$3"
|
|
alignItems="center"
|
|
backgroundColor="white"
|
|
flex={1}
|
|
paddingHorizontal="$4"
|
|
paddingTop="$4"
|
|
paddingBottom={paddingBottom}
|
|
>
|
|
<DebugShortcutsSection navigation={navigation} />
|
|
|
|
{IS_DEV_MODE && (
|
|
<DevTogglesSection
|
|
kycEnabled={kycEnabled}
|
|
setKycEnabled={setKycEnabled}
|
|
useStrongBox={useStrongBox}
|
|
setUseStrongBox={setUseStrongBox}
|
|
/>
|
|
)}
|
|
|
|
<PushNotificationsSection
|
|
hasNotificationPermission={hasNotificationPermission}
|
|
subscribedTopics={subscribedTopics}
|
|
onTopicToggle={handleTopicToggle}
|
|
/>
|
|
|
|
<ParameterSection
|
|
icon={<BugIcon />}
|
|
title="Log Level"
|
|
description="Configure logging verbosity"
|
|
>
|
|
<LogLevelSelector
|
|
currentLevel={loggingSeverity}
|
|
onSelect={setLoggingSeverity}
|
|
/>
|
|
</ParameterSection>
|
|
|
|
{IS_DEV_MODE && (
|
|
<ParameterSection
|
|
icon={<BugIcon />}
|
|
title="Onboarding Error Testing"
|
|
description="Test onboarding error flows"
|
|
>
|
|
<ErrorInjectionSelector />
|
|
</ParameterSection>
|
|
)}
|
|
|
|
<DangerZoneSection
|
|
onClearSecrets={handleClearSecretsPress}
|
|
onClearDocumentCatalog={handleClearDocumentCatalogPress}
|
|
onClearPointEvents={handleClearPointEventsPress}
|
|
onResetBackupState={handleResetBackupStatePress}
|
|
onClearBackupEvents={handleClearBackupEventsPress}
|
|
onClearPendingKyc={handleClearPendingVerificationsPress}
|
|
/>
|
|
</YStack>
|
|
</ScrollView>
|
|
</ErrorBoundary>
|
|
);
|
|
};
|
|
|
|
export default DevSettingsScreen;
|