Files
inji-wallet/components/ui/Loader.tsx
KiruthikaJeyashankar 55c666b121 feat: download credentials from Esignet using openId4VCI (#851)
* 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>
2023-09-22 17:22:59 +05:30

87 lines
2.6 KiB
TypeScript

import React, {Fragment} from 'react';
import {useTranslation} from 'react-i18next';
import {Image, SafeAreaView, View} from 'react-native';
import Spinner from 'react-native-spinkit';
import {Button, Centered, Column, Row, Text} from '../../components/ui';
import {Theme} from '../../components/ui/styleUtils';
import testIDProps from '../../shared/commonUtil';
export const Loader: React.FC<LoaderProps> = props => {
const {t} = useTranslation('ScanScreen');
return (
<Fragment>
<Row elevation={3}>
<SafeAreaView style={Theme.ModalStyles.header}>
<Row
fill
align={'flex-start'}
style={Theme.LoaderStyles.titleContainer}>
<View style={Theme.issuersScreenStyles.loaderHeadingText}>
<Text style={Theme.TextStyles.header} testID="loaderTitle">
{props.title}
</Text>
{props.subTitle && (
<Text
style={Theme.TextStyles.subHeader}
color={Theme.Colors.profileValue}
testID="loaderSubTitle">
{props.subTitle}
</Text>
)}
</View>
</Row>
</SafeAreaView>
</Row>
<Centered crossAlign="center" fill>
<Column margin="24 0" align="space-around">
<Image
source={Theme.InjiProgressingLogo}
height={2}
width={2}
style={{marginLeft: -6}}
{...testIDProps('progressingLogo')}
/>
<View {...testIDProps('threeDotsLoader')}>
<Spinner
type="ThreeBounce"
color={Theme.Colors.Loading}
style={{marginLeft: 6}}
/>
</View>
</Column>
<Column style={{display: props.hint ? 'flex' : 'none'}}>
<Column style={Theme.SelectVcOverlayStyles.timeoutHintContainer}>
<Text
align="center"
color={Theme.Colors.TimoutText}
style={Theme.TextStyles.bold}>
{props.hint}
</Text>
{props.onCancel && (
<Button
type="clear"
title={t('common:cancel')}
onPress={props.onCancel}
/>
)}
</Column>
</Column>
</Centered>
</Fragment>
);
};
export interface LoaderProps {
isVisible: boolean;
title?: string;
subTitle?: string;
label?: string;
hint?: string;
onCancel?: () => void;
requester?: boolean;
progress?: boolean | number;
onBackdropPress?: () => void;
}