Files
inji-wallet/components/BannerNotificationContainer.tsx
KiruthikaJeyashankar 003cc156c2 [INJIMOB-1192] onboarding of new issuer is affecting the existing issuers (#1476)
* [INJIMOB-1192] : use wellknown response instead of mimoto issuer config.
-- Remove hardcoding for sunbird issuer in vc activation and verification flow.
-- Render idType from wellknown response
-- Remove UIN/VID from default add-on fields

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* [INJIMOB-1192] : fix propType and some refactoring

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* [INJIMOB-1192] : add credentialType in VcMetadata

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* [INJIMOB-1192] fix vc download via issuer flow due to credentialType mismatch

Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] rename supported list of credential type in issuers model

Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] display id type in history based on wellknown for issuers VC

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] fix id type not shown for VC activation

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] remove unused credentialType field from VCMetaData

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] set default idType for logging activity

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] move vc item machine events into model

Events should not be exported to other packages for direct use so that Xstate's createModel() can decorate the function appropriately

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] show verify banner id type from wellknown

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] refactor duplication and unused code

Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] remove unused displayId in metadata

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] revert the dimensions of camera scanner to old values to support face liveness verification

Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-1192] remove unused code & debug logs

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1192] fix failing test cases

Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-1192] remove unused translations

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

---------

Signed-off-by: Swati Goel <meet2swati@gmail.com>
Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Co-authored-by: Swati Goel <meet2swati@gmail.com>
Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
2024-06-04 16:37:54 +05:30

111 lines
3.7 KiB
TypeScript

import React from 'react';
import {View} from 'react-native';
import {
BannerNotification,
BannerStatus,
BannerStatusType,
} from './BannerNotification';
import {BackupAndRestoreBannerNotification} from './BackupAndRestoreBannerNotification';
import {UseBannerNotification} from './BannerNotificationController';
import {useTranslation} from 'react-i18next';
import {useScanScreen} from '../screens/Scan/ScanScreenController';
import {Theme} from './ui/styleUtils';
export const BannerNotificationContainer: React.FC<
BannerNotificationContainerProps
> = ({showVerificationStatusBanner = true}) => {
const scanScreenController = useScanScreen();
const showQuickShareSuccessBanner =
scanScreenController.showQuickShareSuccessBanner;
const bannerNotificationController = UseBannerNotification();
const WalletBindingSuccess = bannerNotificationController.isBindingSuccess;
const {t} = useTranslation('BannerNotification');
const rt = useTranslation('RequestScreen').t;
const verificationStatus = bannerNotificationController.verificationStatus;
return (
<>
<BackupAndRestoreBannerNotification />
{WalletBindingSuccess && (
<View style={Theme.BannerStyles.topBanner}>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('activated')}
onClosePress={
bannerNotificationController.RESET_WALLET_BINDING_SUCCESS
}
key={'activatedVcPopup'}
testId={'activatedVcPopup'}
/>
</View>
)}
{showQuickShareSuccessBanner && (
<View style={Theme.BannerStyles.topBanner}>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={rt('status.accepted.message')}
onClosePress={scanScreenController.DISMISS_QUICK_SHARE_BANNER}
key={'quickShareSuccessBanner'}
testId={'quickShareSuccessBanner'}
/>
</View>
)}
{bannerNotificationController.isPasscodeUnlock && (
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('alternatePasscodeSuccess')}
onClosePress={bannerNotificationController.DISMISS}
testId={'alternatePasscodeSuccess'}
key={'updatePassword'}
/>
)}
{bannerNotificationController.isBiometricUnlock && (
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('alternateBiometricSuccess')}
onClosePress={bannerNotificationController.DISMISS}
testId={'alternateBiometricSuccess'}
key={'updateBiometric'}
/>
)}
{verificationStatus !== null && showVerificationStatusBanner && (
<BannerNotification
type={verificationStatus.statusType}
message={t(`VcVerificationBanner:${verificationStatus?.statusType}`, {
vcDetails: `${verificationStatus.vcType} ${verificationStatus.vcNumber}`,
})}
onClosePress={bannerNotificationController.RESET_VERIFICATION_STATUS}
key={'reVerificationInProgress'}
testId={'reVerificationInProgress'}
/>
)}
{bannerNotificationController.isDownloadingFailed && (
<BannerNotification
type={BannerStatusType.ERROR}
message={t('MyVcsTab:downloadingVcFailed')}
onClosePress={bannerNotificationController.RESET_DOWNLOADING_FAILED}
key={'downloadingVcFailedPopup'}
testId={'downloadingVcFailedPopup'}
/>
)}
</>
);
};
export type vcVerificationBannerDetails = {
statusType: BannerStatus;
vcType: string;
vcNumber: string;
};
export interface BannerNotificationContainerProps {
showVerificationStatusBanner?: boolean;
}