mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -05:00
* feat(INJI-245): dowload and view card via issuers Co-authored-by: Harsh Vardhan <harsh59v@gmail.com> * fix(INJI-245): remove vc from wallet Co-authored-by: Harsh Vardhan <harsh59v@gmail.com> * feat(INJI-245): pin card downloaded via eSignet * refactor(INJI-245): remove debug logs * refactor(INJI-245): rename vcItem related component to ExistingVcItem * refactor(INJI-245): add lock file modifications * refactor(INJI-245): add styles in purple theme for issuer related components * refactor(INJI-245): update VID for wallet binding usecase and issuer logo display in vc * refactor(INJI-245): remove duplicate loader component * refactor(INJI-245): remove unused props in vc details container --------- Co-authored-by: Harsh Vardhan <harsh59v@gmail.com> Co-authored-by: Vijay <94220135+vijay151096@users.noreply.github.com>
87 lines
2.5 KiB
TypeScript
87 lines
2.5 KiB
TypeScript
import React from 'react';
|
|
import {useTranslation} from 'react-i18next';
|
|
import {RefreshControl} from 'react-native';
|
|
import {Centered, Column, Text} from '../../components/ui';
|
|
import {Icon} from 'react-native-elements';
|
|
import {Theme} from '../../components/ui/styleUtils';
|
|
import {Modal} from '../../components/ui/Modal';
|
|
import {ExistingMosipVCItem} from '../../components/VC/ExistingMosipVCItem/ExistingMosipVCItem';
|
|
import {ViewVcModal} from '../Home/ViewVcModal';
|
|
|
|
export const ReceivedCardsModal: React.FC<ReceivedCardsProps> = ({
|
|
isVisible,
|
|
controller,
|
|
onDismiss,
|
|
}) => {
|
|
const {t} = useTranslation('ReceivedVcsTab');
|
|
return (
|
|
<Modal
|
|
isVisible={isVisible}
|
|
arrowLeft={<Icon name={''} />}
|
|
headerTitle={t('header')}
|
|
headerElevation={2}
|
|
onDismiss={onDismiss}>
|
|
<Column
|
|
scroll
|
|
pX={15}
|
|
refreshControl={
|
|
<RefreshControl
|
|
refreshing={controller.isRefreshingVcs}
|
|
onRefresh={controller.REFRESH}
|
|
/>
|
|
}>
|
|
{controller.receivedVcsMetadata.map(vcMetadata => (
|
|
<ExistingMosipVCItem
|
|
key={vcMetadata.getVcKey()}
|
|
vcMetadata={vcMetadata}
|
|
margin="0 2 8 2"
|
|
isSharingVc
|
|
onPress={controller.VIEW_VC}
|
|
/>
|
|
))}
|
|
{controller.receivedVcsMetadata.length === 0 && (
|
|
<React.Fragment>
|
|
<Centered fill>
|
|
<Icon
|
|
style={{marginBottom: 20}}
|
|
size={40}
|
|
name="sentiment-dissatisfied"
|
|
/>
|
|
<Text
|
|
testID="noReceivedVcsTitle"
|
|
align="center"
|
|
weight="semibold"
|
|
margin="0 0 4 0">
|
|
{t('noReceivedVcsTitle')}
|
|
</Text>
|
|
<Text
|
|
testID="noReceivedVcsText"
|
|
align="center"
|
|
color={Theme.Colors.textLabel}>
|
|
{t('noReceivedVcsText')}
|
|
</Text>
|
|
</Centered>
|
|
</React.Fragment>
|
|
)}
|
|
</Column>
|
|
{controller.selectedVc && (
|
|
<ViewVcModal
|
|
isVisible={controller.isViewingVc}
|
|
onDismiss={controller.DISMISS_MODAL}
|
|
vcItemActor={controller.selectedVc}
|
|
onRevokeDelete={() => {
|
|
controller.REVOKE();
|
|
}}
|
|
activeTab={controller.activeTab}
|
|
/>
|
|
)}
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export interface ReceivedCardsProps {
|
|
isVisible: boolean;
|
|
controller: any;
|
|
onDismiss: () => void;
|
|
}
|