add mockUser in passportData type

This commit is contained in:
turnoffthiscomputer
2024-08-28 12:18:47 +02:00
parent f788ffbaa8
commit 867aba66ea
7 changed files with 15 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -34,7 +34,7 @@ const MockDataScreen: React.FC = () => {
const sigAlgName = getSignatureAlgorithm(mockPassportData.dsc as string);
const circuitName = getCircuitName("prove", sigAlgName.signatureAlgorithm, sigAlgName.hashFunction);
downloadZkey(circuitName as any);
useNavigationStore.getState().setSelectedTab("app");
useNavigationStore.getState().setSelectedTab("next");
};
return (

View File

@@ -3,7 +3,7 @@ import { YStack, XStack, Text, Image, useWindowDimensions, Fieldset } from 'tama
import { ArrowRight, Info } from '@tamagui/lucide-icons';
import { getFirstName, maskString } from '../../utils/utils';
import { attributeToPosition } from '../../../common/src/constants/constants';
import USER from '../images/user.png'
import USER_PROFILE from '../images/user_profile.png'
import { bgGreen, borderColor, componentBgColor, textBlack, textColor1, textColor2 } from '../utils/colors';
import { Platform } from 'react-native';
import { formatAttribute } from '../utils/utils';
@@ -47,7 +47,7 @@ const NextScreen: React.FC = () => {
h={height > 750 ? 190 : 80}
borderRadius={height > 800 ? "$7" : "$6"}
source={{
uri: USER,
uri: USER_PROFILE,
}}
/>
: <Image
@@ -55,7 +55,7 @@ const NextScreen: React.FC = () => {
h={height > 750 ? 190 : 130}
borderRadius={height > 750 ? "$7" : "$6"}
source={{
uri: passportData.photoBase64 ?? USER,
uri: passportData.mockUser ? USER_PROFILE : passportData.photoBase64 ?? USER_PROFILE,
}}
/>
}
@@ -65,9 +65,11 @@ const NextScreen: React.FC = () => {
<Text color={textBlack} fontSize="$8" style={{
textDecorationLine: "underline", textDecorationColor: bgGreen
}}>{
hideData
? maskString(getFirstName(passportData.mrz))
: getFirstName(passportData.mrz)
passportData.mockUser
? "Anon"
: hideData
? maskString(getFirstName(passportData.mrz))
: getFirstName(passportData.mrz)
}</Text>
{" "}👋
</Text>
@@ -104,7 +106,7 @@ const NextScreen: React.FC = () => {
<XStack bg="#ffff" borderRadius={100} py="$2.5" px="$3">
<Info alignSelf='center' size={24} color={textBlack} />
<Text ml="$3" pr="$6" fontSize="$3" color={textBlack}>Your information will remain confidential and will not be used or shared without your explicit consent.</Text>
<Text ml="$3" pr="$6" fontSize="$2" color={textBlack}>Your information will remain confidential and will not be used or shared without your explicit consent.</Text>
</XStack>
<YStack f={1} />

View File

@@ -166,6 +166,7 @@ const handleResponseIOS = async (
eContent: signedEContentArray,
encryptedDigest: encryptedDigestArray,
photoBase64: "data:image/jpeg;base64," + parsed.passportPhoto,
mockUser: false
};
useUserStore.getState().registerPassportData(passportData)
const sigAlgName = getSignatureAlgorithm(pem);
@@ -229,6 +230,7 @@ const handleResponseAndroid = async (
eContent: JSON.parse(eContent),
encryptedDigest: JSON.parse(encryptedDigest),
photoBase64: photo.base64,
mockUser: false
};
//amplitude.track('Sig alg after conversion: ' + passportData.signatureAlgorithm);

View File

@@ -89,7 +89,8 @@ export function genMockPassportData(
dataGroupHashes: concatenatedDataHashes,
eContent: eContent,
encryptedDigest: signatureBytes,
photoBase64: "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABjElEQVR42mL8//8/AyUYiBQYmIy3..."
photoBase64: "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABjElEQVR42mL8//8/AyUYiBQYmIy3...",
mockUser: true
};
}

View File

@@ -7,6 +7,7 @@ export type PassportData = {
eContent: number[];
encryptedDigest: number[];
photoBase64: string;
mockUser?: boolean;
};
export type Proof = {