mirror of
https://github.com/selfxyz/self.git
synced 2026-01-15 01:28:18 -05:00
add mockUser in passportData type
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 241 KiB |
BIN
app/src/images/user_profile.png
Normal file
BIN
app/src/images/user_profile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -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 (
|
||||
|
||||
@@ -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} />
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ export type PassportData = {
|
||||
eContent: number[];
|
||||
encryptedDigest: number[];
|
||||
photoBase64: string;
|
||||
mockUser?: boolean;
|
||||
};
|
||||
|
||||
export type Proof = {
|
||||
|
||||
Reference in New Issue
Block a user