[INJIMOB-781] fix vc details rendering

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>
This commit is contained in:
srikanth716
2024-05-23 21:49:03 +05:30
parent cb2e08b299
commit 1fedd17e3c
7 changed files with 477 additions and 1756 deletions

View File

@@ -2,7 +2,7 @@ fileignoreconfig:
- filename: package.json
checksum: 5b4fcb5ddc7cc96cc2d1733b544d56ea66e88cdab995a1052fbf9ac0e9c2dc21
- filename: package-lock.json
checksum: 2a85120b444e292a418e007b963bee897ef2d45d3c631b99055b2089963507c1
checksum: cc22f188f28c1431ed8e5c19818ba2d3d761463e64c0606cc92a59a4a52d6c01
- filename: lib/jsonld-signatures/suites/ed255192018/ed25519.ts
checksum: 493b6e31144116cb612c24d98b97d8adcad5609c0a52c865a6847ced0a0ddc3a
- filename: components/PasscodeVerify.tsx

View File

@@ -224,6 +224,7 @@ android {
resValue "string", "app_name", "Inji Wallet Mec"
}
}
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
@@ -242,6 +243,13 @@ android {
}
}
}
packagingOptions {
pickFirst 'lib/arm64-v8a/liblog.so'
pickFirst 'lib/armeabi-v7a/liblog.so'
pickFirst 'lib/x86/liblog.so'
pickFirst 'lib/x86_64/liblog.so'
}
}
dependencies {

View File

@@ -15,7 +15,8 @@ import {
VCItemEvents,
VCItemMachine,
} from '../../../machines/VerifiableCredential/VCItemMachine/VCItemMachine';
import {useCopilot} from 'react-native-copilot';
import {CopilotStep, walkthroughable} from 'react-native-copilot';
import {useTranslation} from 'react-i18next';
export const VCCardView: React.FC<VCItemProps> = props => {
let {
@@ -32,6 +33,9 @@ export const VCCardView: React.FC<VCItemProps> = props => {
KEBAB_POPUP,
} = useVcItemController(props);
const CopilotView = walkthroughable(View);
const {t} = useTranslation();
let formattedDate =
generatedOn && format(new Date(generatedOn), 'MM/dd/yyyy');
@@ -58,18 +62,8 @@ export const VCCardView: React.FC<VCItemProps> = props => {
if (!isVCLoaded(credential, fields)) {
return <VCCardSkeleton />;
}
const {start, goToNth} = useCopilot();
return (
<View
onLayout={
props.isInitialLaunch
? () => {
start();
goToNth(6);
}
: undefined
}>
<React.Fragment>
<Pressable
accessible={false}
onPress={() => props.onPress(service)}
@@ -78,27 +72,60 @@ export const VCCardView: React.FC<VCItemProps> = props => {
? Theme.Styles.selectedBindedVc
: Theme.Styles.closeCardBgContainer
}>
<VCCardViewContent
vcMetadata={props.vcMetadata}
context={context}
walletBindingResponse={walletBindingResponse}
credential={vc}
verifiableCredentialData={verifiableCredentialData}
fields={fields}
wellknown={wellknown}
generatedOn={formattedDate}
selectable={props.selectable}
selected={props.selected}
service={service}
isPinned={props.isPinned}
onPress={() => props.onPress(service)}
isDownloading={props.isDownloading}
flow={props.flow}
isKebabPopUp={isKebabPopUp}
DISMISS={DISMISS}
KEBAB_POPUP={KEBAB_POPUP}
isVerified={props.vcMetadata.isVerified}
/>
{props.isTopCard ? (
<CopilotStep
text={t('copilot:cardMessage')}
order={6}
name={t('copilot:cardTitle')}>
<CopilotView>
<VCCardViewContent
vcMetadata={props.vcMetadata}
context={context}
walletBindingResponse={walletBindingResponse}
credential={vc}
verifiableCredentialData={verifiableCredentialData}
fields={fields}
wellknown={wellknown}
generatedOn={formattedDate}
selectable={props.selectable}
selected={props.selected}
service={service}
isPinned={props.isPinned}
onPress={() => props.onPress(service)}
isDownloading={props.isDownloading}
flow={props.flow}
isKebabPopUp={isKebabPopUp}
DISMISS={DISMISS}
KEBAB_POPUP={KEBAB_POPUP}
isVerified={props.vcMetadata.isVerified}
isInitialLaunch={props.isInitialLaunch}
/>
</CopilotView>
</CopilotStep>
) : (
<VCCardViewContent
vcMetadata={props.vcMetadata}
context={context}
walletBindingResponse={walletBindingResponse}
credential={vc}
verifiableCredentialData={verifiableCredentialData}
fields={fields}
wellknown={wellknown}
generatedOn={formattedDate}
selectable={props.selectable}
selected={props.selected}
service={service}
isPinned={props.isPinned}
onPress={() => props.onPress(service)}
isDownloading={props.isDownloading}
flow={props.flow}
isKebabPopUp={isKebabPopUp}
DISMISS={DISMISS}
KEBAB_POPUP={KEBAB_POPUP}
isVerified={props.vcMetadata.isVerified}
isInitialLaunch={props.isInitialLaunch}
/>
)}
</Pressable>
<ErrorMessageOverlay
isVisible={isSavingFailedInIdle}
@@ -106,7 +133,7 @@ export const VCCardView: React.FC<VCItemProps> = props => {
onDismiss={DISMISS}
translationPath={'VcDetails'}
/>
</View>
</React.Fragment>
);
};
@@ -121,4 +148,5 @@ export interface VCItemProps {
isPinned?: boolean;
flow?: string;
isInitialLaunch: boolean;
isTopCard: boolean;
}

View File

@@ -1,5 +1,5 @@
import React from 'react';
import {ImageBackground, Pressable, Image} from 'react-native';
import {ImageBackground, Pressable, Image, View} from 'react-native';
import {getLocalizedField} from '../../../i18n';
import {VCMetadata} from '../../../shared/VCMetadata';
import {KebabPopUp} from '../../KebabPopUp';
@@ -18,6 +18,7 @@ import {VCItemContainerFlowType} from '../../../shared/Utils';
import {RemoveVcWarningOverlay} from '../../../screens/Home/MyVcs/RemoveVcWarningOverlay';
import {HistoryTab} from '../../../screens/Home/MyVcs/HistoryTab';
import {getTextColor} from '../common/VCUtils';
import {useCopilot} from 'react-native-copilot';
export const VCCardViewContent: React.FC<VCItemContentProps> = props => {
const isVCSelectable = props.selectable && (
@@ -37,6 +38,7 @@ export const VCCardViewContent: React.FC<VCItemContentProps> = props => {
);
const issuerLogo = props.verifiableCredentialData.issuerLogo;
const faceImage = props.verifiableCredentialData.face;
const {start, goToNth} = useCopilot();
return (
<ImageBackground
@@ -46,7 +48,15 @@ export const VCCardViewContent: React.FC<VCItemContentProps> = props => {
Theme.Styles.backgroundImageContainer,
getBackgroundColour(props.wellknown),
]}>
<Column>
<View
onLayout={
props.isInitialLaunch
? () => {
start();
goToNth(6);
}
: undefined
}>
<Row crossAlign="center" padding="3 0 0 3">
{VcItemContainerProfileImage(props)}
<Column fill align={'space-around'} margin="0 10 0 10">
@@ -114,7 +124,7 @@ export const VCCardViewContent: React.FC<VCItemContentProps> = props => {
/>
<HistoryTab service={props.service} vcMetadata={props.vcMetadata} />
</Column>
</View>
</ImageBackground>
);
};
@@ -139,6 +149,7 @@ export interface VCItemContentProps {
isKebabPopUp: boolean;
vcMetadata: VCMetadata;
isVerified?: boolean;
isInitialLaunch?: boolean;
}
VCCardViewContent.defaultProps = {

2027
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -204,14 +204,8 @@ export const MyVcsTab: React.FC<HomeScreenTabProps> = props => {
? numberOfCardsAvailable + ' ' + t('common:cards')
: numberOfCardsAvailable + ' ' + t('common:card');
const CopilotView = walkthroughable(View);
return (
<View
onLayout={controller.isOnboarding ? () => start() : undefined}
style={{
height: Dimensions.get('screen').height * 0.78,
}}>
<React.Fragment>
<Column fill style={{display: props.isVisible ? 'flex' : 'none'}}>
{controller.isRequestSuccessful && (
<BannerNotification
@@ -271,29 +265,7 @@ export const MyVcsTab: React.FC<HomeScreenTabProps> = props => {
</Row>
{showPinVc &&
vcMetadataOrderedByPinStatus.map((vcMetadata, index) => {
return index === 0 ? (
<CopilotStep
key={index}
text={t('copilot:cardMessage')}
order={6}
name={t('copilot:cardTitle')}>
<CopilotView>
<Column>
<VcItemContainer
key={vcMetadata.getVcKey()}
vcMetadata={vcMetadata}
margin="0 2 8 2"
onPress={controller.VIEW_VC}
isDownloading={controller.inProgressVcDownloads?.has(
vcMetadata.getVcKey(),
)}
isPinned={vcMetadata.isPinned}
isInitialLaunch={controller.isInitialDownloading}
/>
</Column>
</CopilotView>
</CopilotStep>
) : (
return (
<VcItemContainer
key={vcMetadata.getVcKey()}
vcMetadata={vcMetadata}
@@ -303,6 +275,8 @@ export const MyVcsTab: React.FC<HomeScreenTabProps> = props => {
vcMetadata.getVcKey(),
)}
isPinned={vcMetadata.isPinned}
isInitialLaunch={controller.isInitialDownloading}
isTopCard={index === 0}
/>
);
})}
@@ -369,26 +343,32 @@ export const MyVcsTab: React.FC<HomeScreenTabProps> = props => {
onRefresh={controller.REFRESH}
/>
}>
{SvgImage.DigitalIdentity()}
<Text
testID="bringYourDigitalID"
style={{paddingTop: 3}}
align="center"
weight="bold"
margin="33 0 6 0"
lineHeight={1}>
{t('bringYourDigitalID')}
</Text>
<Text
<View
onLayout={controller.isOnboarding ? () => start() : undefined}
style={{
...Theme.TextStyles.bold,
paddingTop: 3,
}}
color={Theme.Colors.textLabel}
align="center"
margin="0 12 30 12">
{t('generateVcFABDescription')}
</Text>
alignItems: 'center',
}}>
{SvgImage.DigitalIdentity()}
<Text
testID="bringYourDigitalID"
style={{paddingTop: 3}}
align="center"
weight="bold"
margin="33 0 6 0"
lineHeight={1}>
{t('bringYourDigitalID')}
</Text>
<Text
style={{
...Theme.TextStyles.bold,
paddingTop: 3,
}}
color={Theme.Colors.textLabel}
align="center"
margin="0 12 30 12">
{t('generateVcFABDescription')}
</Text>
</View>
</Column>
</React.Fragment>
)}
@@ -477,6 +457,6 @@ export const MyVcsTab: React.FC<HomeScreenTabProps> = props => {
primaryButtonTestID="tryAgain"
/>
)}
</View>
</React.Fragment>
);
};

View File

@@ -107,7 +107,6 @@ export function useMyVcsTab(props: HomeScreenTabProps) {
vcMetaService?.send(VcMetaEvents.RESET_VERIFY_ERROR());
},
isOnboarding: authService && useSelector(authService, selectIsOnboarding),
isInitialDownloading:
authService && useSelector(authService, selectIsInitialDownload),
isInitialDownloading: useSelector(authService, selectIsInitialDownload),
};
}