Files
inji-wallet/components/BannerNotificationContainer.tsx
KiruthikaJeyashankar 703e03057d Sync release 0.21 (#2165)
* [INJIMOB-3622] Fix alignment in history screen  (#2140)

* [INJIMOB-3622]: clear the history page issue

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3622]: clear the history page issue

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

---------

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3647] refactor: enhance response structure of credential status check (#2145)

* [INJIMOB-3647] refactor: udpate vc verifier RN module

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: update reverification logic

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: modify status response structure

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: update response resolving of status check in swift bridge

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: update info logs to print status message

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: modify type from map to record

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: remove unnecessary async function

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: Credential summary result structure

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

---------

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* Injimob-3651: revert all the branding changes (#2151)

* Revert "[INJIMOB-3622] Fix alignment in history screen  (#2140)"

This reverts commit a0b08914e5.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* Revert "Injimob [3622] [3627] - BANNER ISSUE AND BRANDING CHANGES ISSUES  (#2130)"

This reverts commit 522104811c.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* Revert "[INJIMOB-3633][INJIMOB-3636] fix icon bg color across app (#2134)"

This reverts commit d8d718693d.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* Revert "[INJIMOB-3633] fix search bar clear icon not apperaing (#2133)"

This reverts commit 6a202b11af.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3651]: revert all the branding changes

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3651]: update all the snapshot

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

---------

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3647] refactor: update isRevoked data type (#2149)

* [INJIMOB-3647] refactor: modify data type of isRevoked to EvaluationStatus

Type representing any possible value of EvaluationStatus.

- "TRUE" → Condition was evaluated and is positively true
- "FALSE" → Condition was evaluated and is definitively false
- "UNDETERMINED" → Condition could not be evaluated due to an error

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: modify data type of isRevoked to EvaluationStatus

Type representing any possible value of EvaluationStatus.

- "TRUE" → Condition was evaluated and is positively true
- "FALSE" → Condition was evaluated and is definitively false
- "UNDETERMINED" → Condition could not be evaluated due to an error

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: change statuslistVC type to record from string

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

# Conflicts:
#	shared/vcjs/verifyCredential.ts

* [INJIMOB-3647] refactor: update status revoke check to check for null status

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: VCMetadat constructor isRevoked param

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: rename EvaluationStatus to RevocationStatus

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refactor: modify revocation status logs

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

---------

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* Injimob-3651: update the new branding changes (#2154)

* [INJIMOB-3622]: add the new branding changes

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3651]: update the new branding changes

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3651]: update the new snapshots

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3651]: update the changes mentioned deskcheck

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

---------

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>
Signed-off-by: jaswanthkumartw <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3647] fix error condition in ios revocation (#2157)

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* [INJIMOB-3581] add doc for revocation support (#2158)

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* [INJIMOB-3658] update openid4vp dependencies to 0.6.0 (#2160)

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* INJIMOB-3659: Removing inji wallet ui automation folder from release-0.21.x branch (#2161)

Signed-off-by: maheswaras <maheswara.s@cyberpwn.com>

* INJIMOB-3659: Removing inji wallet ui automation folder from release-0.21.x branch (#2162)

* INJIMOB-3659: Removing inji wallet ui automation folder from release-0.21.x branch

Signed-off-by: maheswaras <maheswara.s@cyberpwn.com>

* INJIMOB-3659: Removing inji wallet ui automation folder from release-0.21.x branch

Signed-off-by: maheswaras <maheswara.s@cyberpwn.com>

---------

Signed-off-by: maheswaras <maheswara.s@cyberpwn.com>

* refactor: replace @expo-google-fonts/montserrat with @expo-google-fonts/inter in package-lock.json

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] fix: change inter to montserrat font

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-3647] refcator: update useFont with montserrat font

Flows - first time VC receved by receiver

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

---------

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>
Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
Signed-off-by: jaswanthkumartw <jaswanthkumar.p@thoughtworks.com>
Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
Signed-off-by: maheswaras <maheswara.s@cyberpwn.com>
Co-authored-by: jaswanthkumartw <jaswanthkumar.p@thoughtworks.com>
Co-authored-by: abhip2565 <paul.apaul.abhishek.AP@gmail.com>
Co-authored-by: maheswaras <maheswara.s@cyberpwn.com>
2025-12-08 17:09:25 +05:30

174 lines
5.9 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';
import {useSettingsScreen} from '../screens/Settings/SettingScreenController';
import {RevocationStatusType} from '../shared/vcVerifier/VcVerifier';
export const BannerNotificationContainer: React.FC<
BannerNotificationContainerProps
> = props => {
const {showVerificationStatusBanner = true} = props;
const scanScreenController = useScanScreen();
const settingsScreenController = useSettingsScreen(props);
const showQuickShareSuccessBanner =
scanScreenController.showQuickShareSuccessBanner;
const bannerNotificationController = UseBannerNotification();
const WalletBindingSuccess = bannerNotificationController.isBindingSuccess;
const reverificationSuccessObject =
bannerNotificationController.isReverificationSuccess;
const reverificationFailureObject =
bannerNotificationController.isReverificationFailed;
const {t} = useTranslation('BannerNotification');
const rt = useTranslation('RequestScreen').t;
const verificationStatus =
bannerNotificationController.verificationStatus || null;
return (
<>
<BackupAndRestoreBannerNotification />
{settingsScreenController.isKeyOrderSet === true && (
<View style={Theme.BannerStyles.topBanner}>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('keyPreferenceSuccess')}
onClosePress={settingsScreenController.RESET_KEY_ORDER_RESPONSE}
key={'keyOrderingSuccess'}
testId={'keyOrderingSuccess'}
/>
</View>
)}
{settingsScreenController.isKeyOrderSet === false && (
<View style={Theme.BannerStyles.topBanner}>
<BannerNotification
type={BannerStatusType.ERROR}
message={t('keyPreferenceError')}
onClosePress={settingsScreenController.RESET_KEY_ORDER_RESPONSE}
key={'keyOrderingError'}
testId={'keyOrderingError'}
/>
</View>
)}
{WalletBindingSuccess && (
<View style={Theme.BannerStyles.topBanner}>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('activated')}
onClosePress={
bannerNotificationController.RESET_WALLET_BINDING_SUCCESS
}
key={'activatedVcPopup'}
testId={'activatedVcPopup'}
/>
</View>
)}
{reverificationSuccessObject.status && (
<View style={Theme.BannerStyles.topBanner}>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t(
`reverifiedSuccessfully.${reverificationSuccessObject.statusValue}`,
{vcType: reverificationSuccessObject.vcType},
)}
onClosePress={
bannerNotificationController.RESET_REVIRIFICATION_SUCCESS
}
key={'reverifiedSuccessfullyPopup'}
testId={'reverifiedSuccessfullyPopup'}
/>
</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'}
/>
)}
{bannerNotificationController.isDownloadingFailed && (
<BannerNotification
type={BannerStatusType.ERROR}
message={t('MyVcsTab:downloadingVcFailed')}
onClosePress={bannerNotificationController.RESET_DOWNLOADING_FAILED}
key={'downloadingVcFailedPopup'}
testId={'downloadingVcFailedPopup'}
/>
)}
{reverificationFailureObject.status && (
<BannerNotification
type={BannerStatusType.ERROR}
message={t(
`reverificationFailed.${reverificationFailureObject.statusValue}`,
{vcType: reverificationFailureObject.vcType},
)}
onClosePress={
bannerNotificationController.RESET_REVERIFICATION_FAILURE
}
key={'reverificationFailedPopup'}
testId={'reverificationFailedPopup'}
/>
)}
{bannerNotificationController.isDownloadingSuccess && (
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('MyVcsTab:downloadingVcSuccess')}
onClosePress={bannerNotificationController.RESET_DOWNLOADING_SUCCESS}
key={'downloadingVcSuccessPopup'}
testId={'downloadingVcSuccessPopup'}
/>
)}
</>
);
};
export type vcVerificationBannerDetails = {
statusType: BannerStatus;
isRevoked: RevocationStatusType;
isExpired: boolean;
vcType: string;
};
export interface BannerNotificationContainerProps {
showVerificationStatusBanner?: boolean;
}