mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -05:00
Injimob 2277 handle expired vc (#1679)
* [INJIMOB-2272]: Expired Vc UI changes based on error code Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com> * [INJIMOB-2272]: Hide activation from Kebab Popup and activation icons for Expired Vcs. Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com> * [INJIMOB-2277]: Combine the actions for verified and expired flag.Update kebabmenu options condition. Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com> * [INJIMOB-2277]: Update VcVerification props to accept vcMetadata. Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com> --------- Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>
This commit is contained in:
@@ -100,7 +100,6 @@ export const VCCardView: React.FC<VCItemProps> = props => {
|
||||
isKebabPopUp={controller.isKebabPopUp}
|
||||
DISMISS={controller.DISMISS}
|
||||
KEBAB_POPUP={controller.KEBAB_POPUP}
|
||||
isVerified={props.vcMetadata.isVerified}
|
||||
isInitialLaunch={props.isInitialLaunch}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -89,7 +89,7 @@ export const VCCardViewContent: React.FC<VCItemContentProps> = props => {
|
||||
<Row>
|
||||
<VCVerification
|
||||
wellknown={props.wellknown}
|
||||
isVerified={props.isVerified}
|
||||
vcMetadata={props.verifiableCredentialData?.vcMetadata}
|
||||
/>
|
||||
</Row>
|
||||
</Column>
|
||||
@@ -106,10 +106,11 @@ export const VCCardViewContent: React.FC<VCItemContentProps> = props => {
|
||||
|
||||
{!Object.values(VCItemContainerFlowType).includes(props.flow) && (
|
||||
<>
|
||||
{!props.walletBindingResponse &&
|
||||
isActivationNeeded(props.verifiableCredentialData?.issuer)
|
||||
? SvgImage.walletUnActivatedIcon()
|
||||
: SvgImage.walletActivatedIcon()}
|
||||
{!props.verifiableCredentialData?.vcMetadata.isExpired &&
|
||||
(!props.walletBindingResponse &&
|
||||
isActivationNeeded(props.verifiableCredentialData?.issuer)
|
||||
? SvgImage.walletUnActivatedIcon()
|
||||
: SvgImage.walletActivatedIcon())}
|
||||
<Pressable
|
||||
onPress={props.KEBAB_POPUP}
|
||||
accessible={false}
|
||||
@@ -166,7 +167,6 @@ export interface VCItemContentProps {
|
||||
DISMISS: () => {};
|
||||
isKebabPopUp: boolean;
|
||||
vcMetadata: VCMetadata;
|
||||
isVerified?: boolean;
|
||||
isInitialLaunch?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,86 +158,87 @@ export const VCDetailView: React.FC<VCItemDetailsProps> = props => {
|
||||
</Column>
|
||||
</Column>
|
||||
</Column>
|
||||
{props.vcHasImage && (
|
||||
<View
|
||||
style={{
|
||||
position: 'relative',
|
||||
backgroundColor: Theme.Colors.DetailedViewBackground,
|
||||
}}>
|
||||
{props.activeTab !== 1 &&
|
||||
(!props.walletBindingResponse &&
|
||||
isActivationNeeded(props.verifiableCredentialData?.issuer) ? (
|
||||
<Column
|
||||
padding="10"
|
||||
style={Theme.Styles.detailedViewActivationPopupContainer}>
|
||||
<Row>
|
||||
<Column crossAlign="flex-start" margin={'2 0 0 10'}>
|
||||
{SvgImage.WalletUnActivatedLargeIcon()}
|
||||
</Column>
|
||||
<Column crossAlign="flex-start" margin={'5 18 13 8'}>
|
||||
<Text
|
||||
testID="offlineAuthDisabledHeader"
|
||||
style={{
|
||||
fontFamily: 'Inter_600SemiBold',
|
||||
fontSize: 14,
|
||||
}}
|
||||
color={Theme.Colors.statusLabel}
|
||||
margin={'0 18 0 0'}>
|
||||
{t('offlineAuthDisabledHeader')}
|
||||
</Text>
|
||||
<Text
|
||||
testID="offlineAuthDisabledMessage"
|
||||
style={{
|
||||
fontFamily: 'Inter_400Regular',
|
||||
fontSize: 12,
|
||||
}}
|
||||
color={Theme.Colors.statusMessage}
|
||||
margin={'0 18 0 0'}>
|
||||
{t('offlineAuthDisabledMessage')}
|
||||
</Text>
|
||||
</Column>
|
||||
</Row>
|
||||
{props.vcHasImage &&
|
||||
!props.verifiableCredentialData?.vcMetadata.isExpired && (
|
||||
<View
|
||||
style={{
|
||||
position: 'relative',
|
||||
backgroundColor: Theme.Colors.DetailedViewBackground,
|
||||
}}>
|
||||
{props.activeTab !== 1 &&
|
||||
(!props.walletBindingResponse &&
|
||||
isActivationNeeded(props.verifiableCredentialData?.issuer) ? (
|
||||
<Column
|
||||
padding="10"
|
||||
style={Theme.Styles.detailedViewActivationPopupContainer}>
|
||||
<Row>
|
||||
<Column crossAlign="flex-start" margin={'2 0 0 10'}>
|
||||
{SvgImage.WalletUnActivatedLargeIcon()}
|
||||
</Column>
|
||||
<Column crossAlign="flex-start" margin={'5 18 13 8'}>
|
||||
<Text
|
||||
testID="offlineAuthDisabledHeader"
|
||||
style={{
|
||||
fontFamily: 'Inter_600SemiBold',
|
||||
fontSize: 14,
|
||||
}}
|
||||
color={Theme.Colors.statusLabel}
|
||||
margin={'0 18 0 0'}>
|
||||
{t('offlineAuthDisabledHeader')}
|
||||
</Text>
|
||||
<Text
|
||||
testID="offlineAuthDisabledMessage"
|
||||
style={{
|
||||
fontFamily: 'Inter_400Regular',
|
||||
fontSize: 12,
|
||||
}}
|
||||
color={Theme.Colors.statusMessage}
|
||||
margin={'0 18 0 0'}>
|
||||
{t('offlineAuthDisabledMessage')}
|
||||
</Text>
|
||||
</Column>
|
||||
</Row>
|
||||
|
||||
<Button
|
||||
testID="enableVerification"
|
||||
title={t('enableVerification')}
|
||||
onPress={props.onBinding}
|
||||
type="gradient"
|
||||
size="Large"
|
||||
disabled={
|
||||
!props.verifiableCredentialData.vcMetadata.isVerified
|
||||
}
|
||||
/>
|
||||
</Column>
|
||||
) : (
|
||||
<Column
|
||||
style={Theme.Styles.detailedViewActivationPopupContainer}
|
||||
padding="10">
|
||||
<Row>
|
||||
<Column crossAlign="flex-start" margin={'2 0 0 10'}>
|
||||
{SvgImage.WalletActivatedLargeIcon()}
|
||||
</Column>
|
||||
<Column crossAlign="flex-start" margin={'5 18 13 8'}>
|
||||
<Text
|
||||
testID="profileAuthenticated"
|
||||
color={Theme.Colors.statusLabel}
|
||||
style={{
|
||||
fontFamily: 'Inter_600SemiBold',
|
||||
fontSize: 14,
|
||||
}}
|
||||
margin={'0 18 0 0'}>
|
||||
{isActivationNeeded(
|
||||
props.verifiableCredentialData?.issuer,
|
||||
)
|
||||
? t('profileAuthenticated')
|
||||
: t('credentialActivated')}
|
||||
</Text>
|
||||
</Column>
|
||||
</Row>
|
||||
</Column>
|
||||
))}
|
||||
</View>
|
||||
)}
|
||||
<Button
|
||||
testID="enableVerification"
|
||||
title={t('enableVerification')}
|
||||
onPress={props.onBinding}
|
||||
type="gradient"
|
||||
size="Large"
|
||||
disabled={
|
||||
!props.verifiableCredentialData.vcMetadata.isVerified
|
||||
}
|
||||
/>
|
||||
</Column>
|
||||
) : (
|
||||
<Column
|
||||
style={Theme.Styles.detailedViewActivationPopupContainer}
|
||||
padding="10">
|
||||
<Row>
|
||||
<Column crossAlign="flex-start" margin={'2 0 0 10'}>
|
||||
{SvgImage.WalletActivatedLargeIcon()}
|
||||
</Column>
|
||||
<Column crossAlign="flex-start" margin={'5 18 13 8'}>
|
||||
<Text
|
||||
testID="profileAuthenticated"
|
||||
color={Theme.Colors.statusLabel}
|
||||
style={{
|
||||
fontFamily: 'Inter_600SemiBold',
|
||||
fontSize: 14,
|
||||
}}
|
||||
margin={'0 18 0 0'}>
|
||||
{isActivationNeeded(
|
||||
props.verifiableCredentialData?.issuer,
|
||||
)
|
||||
? t('profileAuthenticated')
|
||||
: t('credentialActivated')}
|
||||
</Text>
|
||||
</Column>
|
||||
</Row>
|
||||
</Column>
|
||||
))}
|
||||
</View>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -76,7 +76,7 @@ export const getFieldValue = (
|
||||
return (
|
||||
<VCVerification
|
||||
wellknown={wellknown}
|
||||
isVerified={props.verifiableCredentialData.vcMetadata.isVerified}
|
||||
vcMetadata={props.verifiableCredentialData.vcMetadata}
|
||||
/>
|
||||
);
|
||||
case 'idType':
|
||||
|
||||
Reference in New Issue
Block a user