From 0f5d8cbff54961d12db2606260d2b5af0b13327d Mon Sep 17 00:00:00 2001 From: Evi Nova <66773372+Tranquil-Flow@users.noreply.github.com> Date: Fri, 20 Feb 2026 20:04:01 +1000 Subject: [PATCH] fix: show country nationality in view id card screen (#1777) * fix: show country nationality in view id card screen Was showing country code, now tries to fetch the country name. If can't find, resolves back to raw country code. * port fix over --------- Co-authored-by: Justin Hernandez --- app/src/components/homescreen/IdCardRevealed.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/components/homescreen/IdCardRevealed.tsx b/app/src/components/homescreen/IdCardRevealed.tsx index dc3fa7078..d977abfa5 100644 --- a/app/src/components/homescreen/IdCardRevealed.tsx +++ b/app/src/components/homescreen/IdCardRevealed.tsx @@ -8,6 +8,7 @@ import { Dimensions } from 'react-native'; import { Separator, Text, XStack, YStack } from 'tamagui'; import type { AadhaarData } from '@selfxyz/common'; +import { commonNames } from '@selfxyz/common/constants'; import type { PassportData } from '@selfxyz/common/types/passport'; import { isAadhaarDocument, isMRZDocument } from '@selfxyz/common/utils/types'; import { @@ -37,6 +38,17 @@ const logoSvg = ` `; +/** + * Resolve a 3-letter country code to its full country name. + * Falls back to the code itself if no mapping exists. + */ +const getCountryName = (code: string): string => { + if (!code) return ''; + const cleaned = code.toUpperCase().replace(/)[cleaned] || cleaned; +}; + interface IdCardRevealedProps { idDocument: PassportData | AadhaarData; } @@ -237,7 +249,7 @@ const IdCardRevealed: FC = ({ idDocument }) => { @@ -257,7 +269,7 @@ const IdCardRevealed: FC = ({ idDocument }) => {