mirror of
https://github.com/selfxyz/self.git
synced 2026-02-19 02:24:25 -05:00
chore: address additional sumsub feedback (#1735)
* agent feedback * fix settings screen color
This commit is contained in:
@@ -109,13 +109,25 @@ const KycIdCard: FC<KycIdCardProps> = ({
|
||||
selected,
|
||||
hidden: _hidden,
|
||||
}) => {
|
||||
// Extract KYC fields from serialized applicant info
|
||||
const applicantInfo = deserializeApplicantInfo(
|
||||
idDocument.serializedApplicantInfo,
|
||||
);
|
||||
const country = applicantInfo.country || '';
|
||||
const idType = applicantInfo.idType || '';
|
||||
const idNumber = applicantInfo.idNumber || '';
|
||||
// Extract KYC fields from serialized applicant info with error handling
|
||||
let country = '';
|
||||
let idType = '';
|
||||
let idNumber = '';
|
||||
|
||||
try {
|
||||
const applicantInfo = deserializeApplicantInfo(
|
||||
idDocument.serializedApplicantInfo,
|
||||
);
|
||||
country = applicantInfo.country || '';
|
||||
idType = applicantInfo.idType || '';
|
||||
idNumber = applicantInfo.idNumber || '';
|
||||
} catch (error) {
|
||||
console.error(
|
||||
'[KycIdCard] Failed to deserialize applicant info, using fallback values:',
|
||||
error,
|
||||
);
|
||||
// Fallback to safe defaults - component will render generic "ID CARD" display
|
||||
}
|
||||
|
||||
const docTitle = getKycDocTitle(idType);
|
||||
const countryAdj = getCountryAdjective(country);
|
||||
|
||||
@@ -69,7 +69,6 @@ export function usePendingKycRecovery() {
|
||||
);
|
||||
|
||||
if (processingWithDocument) {
|
||||
hasAttemptedRecoveryRef.current.add(processingWithDocument.userId);
|
||||
console.log(
|
||||
'[PendingKycRecovery] Resuming processing verification, navigating to KYCVerified:',
|
||||
processingWithDocument.userId,
|
||||
@@ -78,8 +77,15 @@ export function usePendingKycRecovery() {
|
||||
navigationRef.navigate('KYCVerified', {
|
||||
documentId: processingWithDocument.documentId,
|
||||
});
|
||||
// Only mark as attempted after successful navigation
|
||||
hasAttemptedRecoveryRef.current.add(processingWithDocument.userId);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
// Navigation not ready yet - don't mark as attempted, allow retry
|
||||
console.log(
|
||||
'[PendingKycRecovery] Navigation not ready, will retry recovery for:',
|
||||
processingWithDocument.userId,
|
||||
);
|
||||
}
|
||||
|
||||
const firstPending = pendingVerifications.find(
|
||||
|
||||
@@ -15,10 +15,10 @@ import { Bug, FileText, Settings2 } from '@tamagui/lucide-icons';
|
||||
|
||||
import { BodyText, pressedStyle } from '@selfxyz/mobile-sdk-alpha/components';
|
||||
import {
|
||||
amber500,
|
||||
black,
|
||||
neutral700,
|
||||
slate800,
|
||||
warmCream,
|
||||
white,
|
||||
} from '@selfxyz/mobile-sdk-alpha/constants/colors';
|
||||
|
||||
@@ -150,7 +150,7 @@ const SocialButton: React.FC<SocialButtonProps> = ({ Icon, href }) => {
|
||||
unstyled
|
||||
hitSlop={8}
|
||||
onPress={onPress}
|
||||
icon={<Icon height={32} width={32} color={amber500} />}
|
||||
icon={<Icon height={32} width={32} color={warmCream} />}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -309,7 +309,7 @@ const SettingsScreen: React.FC = () => {
|
||||
<SocialButton key={i} Icon={Icon} href={href} />
|
||||
))}
|
||||
</XStack>
|
||||
<BodyText style={{ color: amber500, fontSize: 15 }}>
|
||||
<BodyText style={{ color: warmCream, fontSize: 15 }}>
|
||||
SELF
|
||||
</BodyText>
|
||||
{/* Dont remove if not viewing on ios */}
|
||||
|
||||
@@ -159,18 +159,18 @@ const PassportDataSelector = () => {
|
||||
return 'Verified ID';
|
||||
}
|
||||
|
||||
switch (applicantInfo.idType) {
|
||||
case 'ID_CARD':
|
||||
return 'ID Card';
|
||||
case 'DRIVERS_LICENCE':
|
||||
return "Driver's Licence";
|
||||
case 'PASSPORT':
|
||||
return 'Passport';
|
||||
case 'AADHAAR':
|
||||
return 'Aadhaar';
|
||||
default:
|
||||
return 'Verified ID';
|
||||
}
|
||||
// Normalize idType for fuzzy matching (handles "drivers_licence", "NATIONAL ID", etc.)
|
||||
const normalized = applicantInfo.idType
|
||||
.toLowerCase()
|
||||
.replace(/[_\s]+/g, ' ')
|
||||
.trim();
|
||||
|
||||
if (normalized.includes('driver')) return "Driver's Licence";
|
||||
if (normalized.includes('passport')) return 'Passport';
|
||||
if (normalized.includes('aadhaar')) return 'Aadhaar';
|
||||
if (normalized.includes('national')) return 'National ID';
|
||||
if (normalized.includes('residence')) return 'Residence Permit';
|
||||
return 'ID Card';
|
||||
};
|
||||
|
||||
const getDisplayName = (metadata: DocumentMetadata): string => {
|
||||
|
||||
Reference in New Issue
Block a user