mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 05:27:57 -05:00
[INJIMOB-3661] fix alignment of about Inji | [INJIMOB-3663] fix: id type not shown in history on fresh shared VC (#2170)
* [INJIMOB-3639] fix: change app name to Inji from resident app Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3661] fix: change description according to figma and font family change to Montserrat Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [INJIMOB-3647] fix: history ID type not shown Flows - restore, Receive Vc by the receiver Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3663] fix: history ID type not shown Flows - first time VC receved by receiver Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3625] fix date format to consistent format across app (#2127) Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> --------- Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> Co-authored-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> Co-authored-by: abhip2565 <paul.apaul.abhishek.AP@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a6f679c78c
commit
9e7bed6c72
@@ -17,6 +17,8 @@ import {
|
||||
import {selectIsSavingFailedInIdle} from '../../screens/Home/MyVcsTabMachine';
|
||||
import {selectIsTourGuide} from '../../machines/auth';
|
||||
import {VCMetadata} from "../../shared/VCMetadata";
|
||||
import {ActivityLogEvents} from "../../machines/activityLog";
|
||||
import {IssuerWellknownResponse} from "../../machines/VerifiableCredential/VCMetaMachine/vc";
|
||||
|
||||
export function useVcItemController(vcMetadata: VCMetadata) {
|
||||
const {appService} = useContext(GlobalContext);
|
||||
@@ -28,6 +30,7 @@ export function useVcItemController(vcMetadata: VCMetadata) {
|
||||
);
|
||||
const VCItemService = useInterpret(machine.current, {devTools: __DEV__});
|
||||
const authService = appService.children.get('auth');
|
||||
const activityService = appService.children.get('activityLog');
|
||||
|
||||
return {
|
||||
VCItemService,
|
||||
@@ -54,5 +57,9 @@ export function useVcItemController(vcMetadata: VCMetadata) {
|
||||
storeErrorTranslationPath: 'errors.savingFailed',
|
||||
generatedOn: useSelector(VCItemService, selectGeneratedOn),
|
||||
isTourGuide: useSelector(authService, selectIsTourGuide),
|
||||
STORE_INCOMING_VC_WELLKNOWN_CONFIG: (issuer: string, wellknown: IssuerWellknownResponse) =>
|
||||
activityService?.send(
|
||||
ActivityLogEvents.STORE_INCOMING_VC_WELLKNOWN_CONFIG(issuer, wellknown),
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import * as React from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { Pressable, View } from 'react-native';
|
||||
import { ActorRefFrom } from 'xstate';
|
||||
import { ErrorMessageOverlay, MessageOverlay } from '../../MessageOverlay';
|
||||
import { Theme } from '../../ui/styleUtils';
|
||||
import { VCMetadata } from '../../../shared/VCMetadata';
|
||||
import { format } from 'date-fns';
|
||||
import {useEffect, useRef, useState} from 'react';
|
||||
import {Pressable, View} from 'react-native';
|
||||
import {ActorRefFrom} from 'xstate';
|
||||
import {ErrorMessageOverlay, MessageOverlay} from '../../MessageOverlay';
|
||||
import {Theme} from '../../ui/styleUtils';
|
||||
import {VCMetadata} from '../../../shared/VCMetadata';
|
||||
import {format} from 'date-fns';
|
||||
|
||||
import { VCCardSkeleton } from '../common/VCCardSkeleton';
|
||||
import { VCCardViewContent } from './VCCardViewContent';
|
||||
import { useVcItemController } from '../VCItemController';
|
||||
import { getCredentialIssuersWellKnownConfig } from '../../../shared/openId4VCI/Utils';
|
||||
import { CARD_VIEW_DEFAULT_FIELDS, isVCLoaded } from '../common/VCUtils';
|
||||
import { VCItemMachine } from '../../../machines/VerifiableCredential/VCItemMachine/VCItemMachine';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Copilot } from '../../ui/Copilot';
|
||||
import { VCProcessor } from '../common/VCProcessor';
|
||||
import {VCCardSkeleton} from '../common/VCCardSkeleton';
|
||||
import {VCCardViewContent} from './VCCardViewContent';
|
||||
import {useVcItemController} from '../VCItemController';
|
||||
import {getCredentialIssuersWellKnownConfig} from '../../../shared/openId4VCI/Utils';
|
||||
import {CARD_VIEW_DEFAULT_FIELDS, isVCLoaded} from '../common/VCUtils';
|
||||
import {VCItemMachine} from '../../../machines/VerifiableCredential/VCItemMachine/VCItemMachine';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {Copilot} from '../../ui/Copilot';
|
||||
import {VCProcessor} from '../common/VCProcessor';
|
||||
|
||||
export const VCCardView: React.FC<VCItemProps> = ({
|
||||
vcMetadata,
|
||||
@@ -31,7 +31,7 @@ export const VCCardView: React.FC<VCItemProps> = ({
|
||||
onMeasured,
|
||||
}) => {
|
||||
const controller = useVcItemController(vcMetadata);
|
||||
const { t } = useTranslation();
|
||||
const {t} = useTranslation();
|
||||
const cardRef = useRef<View>(null);
|
||||
|
||||
const service = controller.VCItemService;
|
||||
@@ -54,15 +54,14 @@ export const VCCardView: React.FC<VCItemProps> = ({
|
||||
const handle = requestAnimationFrame(() => {
|
||||
cardRef.current?.measureInWindow((x, y, width, height) => {
|
||||
if (width > 0 && height > 0) {
|
||||
onMeasured({ x, y, width, height });
|
||||
onMeasured({x, y, width, height});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
return () => cancelAnimationFrame(handle);
|
||||
}
|
||||
}, [onMeasured]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
async function loadVc() {
|
||||
@@ -78,10 +77,11 @@ export const VCCardView: React.FC<VCItemProps> = ({
|
||||
}, [isDownloading, controller.credential]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!verifiableCredentialData || !verifiableCredentialData.vcMetadata) return;
|
||||
if (!verifiableCredentialData || !verifiableCredentialData.vcMetadata)
|
||||
return;
|
||||
const {
|
||||
credentialConfigurationId,
|
||||
vcMetadata: { format },
|
||||
vcMetadata: {format},
|
||||
} = verifiableCredentialData;
|
||||
|
||||
if (vcMetadata.issuerHost) {
|
||||
@@ -96,10 +96,14 @@ export const VCCardView: React.FC<VCItemProps> = ({
|
||||
if (response && response.matchingCredentialIssuerMetadata) {
|
||||
setWellknown(response.matchingCredentialIssuerMetadata);
|
||||
}
|
||||
controller.STORE_INCOMING_VC_WELLKNOWN_CONFIG(
|
||||
verifiableCredentialData?.vcMetadata.issuerHost,
|
||||
response.wellknownResponse,
|
||||
);
|
||||
setFields(response.fields);
|
||||
})
|
||||
.catch(error => {
|
||||
setWellknown({ fallback: 'true' });
|
||||
setWellknown({fallback: 'true'});
|
||||
console.error(
|
||||
'Error occurred while fetching wellknown for viewing VC ',
|
||||
error,
|
||||
@@ -186,5 +190,10 @@ export interface VCItemProps {
|
||||
isInitialLaunch?: boolean;
|
||||
isTopCard?: boolean;
|
||||
onDisclosuresChange?: (paths: string[]) => void;
|
||||
onMeasured?: (rect: { x: number; y: number; width: number; height: number }) => void;
|
||||
}
|
||||
onMeasured?: (rect: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}) => void;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {Theme} from './ui/styleUtils';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {VCMetadata} from '../shared/VCMetadata';
|
||||
import {RevocationStatus} from '../shared/vcVerifier/VcVerifier';
|
||||
import {formattedDate} from '../shared/openId4VCI/Utils';
|
||||
|
||||
export const VCVerification: React.FC<VCVerificationProps> = ({
|
||||
vcMetadata,
|
||||
@@ -76,7 +77,7 @@ export const VCVerification: React.FC<VCVerificationProps> = ({
|
||||
Theme.Styles.verificationStatus,
|
||||
{fontFamily: 'Montserrat_400'},
|
||||
]}>
|
||||
{new Date(vcMetadata.lastKnownStatusTimestamp).toLocaleString()}
|
||||
{formattedDate(vcMetadata.lastKnownStatusTimestamp)}
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
StyleSheet,
|
||||
ViewStyle,
|
||||
} from 'react-native';
|
||||
import {Spacing} from '../styleUtils';
|
||||
import {Spacing, Theme} from '../styleUtils';
|
||||
import {COPILOT_HEIGHT, isIOS, isAndroid} from '../../../shared/constants';
|
||||
import Constants from 'expo-constants';
|
||||
import HomeScreenLogo from '../../../assets/InjiHomeLogo.svg';
|
||||
@@ -1974,8 +1974,8 @@ export const DefaultTheme = {
|
||||
},
|
||||
|
||||
logoStyle: {
|
||||
width: 24,
|
||||
height: 24,
|
||||
width: 40,
|
||||
height: 40,
|
||||
marginRight: 5,
|
||||
marginTop: 12,
|
||||
},
|
||||
@@ -1990,6 +1990,12 @@ export const DefaultTheme = {
|
||||
height: 1,
|
||||
},
|
||||
poweredByTextStyle: {
|
||||
fontSize: 16,
|
||||
paddingTop: 15,
|
||||
maxWidth: 250,
|
||||
},
|
||||
infoTextStyle: {
|
||||
fontSize: 13,
|
||||
paddingTop: 15,
|
||||
maxWidth: 250,
|
||||
},
|
||||
|
||||
@@ -1994,8 +1994,8 @@ export const PurpleTheme = {
|
||||
marginBottom: 4,
|
||||
},
|
||||
logoStyle: {
|
||||
width: 24,
|
||||
height: 24,
|
||||
width: 40,
|
||||
height: 40,
|
||||
marginRight: 5,
|
||||
},
|
||||
tuvaliVerisonStyle: {
|
||||
@@ -2009,6 +2009,12 @@ export const PurpleTheme = {
|
||||
height: 1,
|
||||
},
|
||||
poweredByTextStyle: {
|
||||
fontSize: 16,
|
||||
paddingTop: 15,
|
||||
maxWidth: 250,
|
||||
},
|
||||
infoTextStyle: {
|
||||
fontSize: 13,
|
||||
paddingTop: 15,
|
||||
maxWidth: 250,
|
||||
},
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Allow $(PRODUCT_NAME) to access your camera</string>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>Resident app can be unlocked using Face ID</string>
|
||||
<string>$(PRODUCT_NAME) can be unlocked using Face ID</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>Allow $(PRODUCT_NAME) to access your location</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
|
||||
@@ -116,7 +116,8 @@ export const activityLogMachine =
|
||||
|
||||
setActivities: model.assign({
|
||||
activities: (_, event) => {
|
||||
return (event.response || []) as VCActivityLog[]},
|
||||
return (event.response || []) as VCActivityLog[];
|
||||
},
|
||||
}),
|
||||
|
||||
storeActivity: send(
|
||||
@@ -130,7 +131,8 @@ export const activityLogMachine =
|
||||
const updatedWellKnownIssuerMap = {
|
||||
...context.wellKnownIssuerMap,
|
||||
};
|
||||
updatedWellKnownIssuerMap[event.log.issuer] = event.wellknown;
|
||||
if (!updatedWellKnownIssuerMap[event.log.issuer])
|
||||
updatedWellKnownIssuerMap[event.log.issuer] = event.wellknown;
|
||||
return updatedWellKnownIssuerMap as unknown as Record<
|
||||
string,
|
||||
Object
|
||||
|
||||
@@ -87,7 +87,7 @@ export const ReceiveVcScreen: React.FC = () => {
|
||||
setWellknown(response.matchingCredentialIssuerMetadata);
|
||||
setFields(response.fields);
|
||||
controller.STORE_INCOMING_VC_WELLKNOWN_CONFIG(
|
||||
verifiableCredentialData?.issuer,
|
||||
verifiableCredentialData?.vcMetadata.issuerHost,
|
||||
response.wellknownResponse,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -340,7 +340,7 @@ export const SendVPScreen: React.FC<ScanLayoutProps> = props => {
|
||||
<Text
|
||||
style={{
|
||||
color: Theme.Colors.Icon,
|
||||
fontFamily: 'Inter_600SemiBold',
|
||||
fontFamily: 'Montserrat_600SemiBold',
|
||||
}}
|
||||
onPress={
|
||||
areAllVcsChecked
|
||||
|
||||
@@ -142,7 +142,7 @@ export const AboutInji: React.FC<AboutInjiProps> = ({appId}) => {
|
||||
style={Theme.AboutInjiScreenStyle.footerContainer}>
|
||||
<Row style={Theme.AboutInjiScreenStyle.poweredByRow}>
|
||||
<View style={Theme.AboutInjiScreenStyle.logoStyle}>
|
||||
{SvgImage.logoIcon(24, 24)}
|
||||
{SvgImage.logoIcon(40, 40)}
|
||||
</View>
|
||||
|
||||
<Text
|
||||
@@ -155,8 +155,8 @@ export const AboutInji: React.FC<AboutInjiProps> = ({appId}) => {
|
||||
|
||||
<Text
|
||||
weight="semibold"
|
||||
style={Theme.AboutInjiScreenStyle.poweredByTextStyle}
|
||||
color="black">
|
||||
style={Theme.AboutInjiScreenStyle.infoTextStyle}
|
||||
color={Theme.Colors.GrayText}>
|
||||
{t('copyright')}
|
||||
</Text>
|
||||
</Column>
|
||||
|
||||
Reference in New Issue
Block a user