Files
inji-wallet/components/BannerNotificationContainer.tsx
jaswanthkumartw 522104811c Injimob [3622] [3627] - BANNER ISSUE AND BRANDING CHANGES ISSUES (#2130)
* [INJIMOB-3622]: cleared the bug related to banner

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

* [INJIMOB-3622]: updated .talismanrc file

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

* [INJIMOB-3622]: cleared the bug related to banner

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

* [INJIMOB-3622]: cleared the bug related to banner

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

* [INJIMOB-3622]: updated .talismanrc

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

* [INJIMOB-3622]: updated update the snapshots for tests

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

* [INJIMOB-3622]: clear the issue according to review comments

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

* [INJIMOB-3627]: added icons to the screen

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

* [INJIMOB-3627]: added .talismanrc

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

* [INJIMOB-3639] fix: modify face permission consent app name

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

* [INJIMOB-3628] fix status tooltip content overflow.

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

* [INJIMOB-3622]: cleared the header overlaping issue

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

* [INJIMOB-3622] fix: banner hidden in backup / restore screen

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

* [INJIMOB-3622] fix: banner hidden in vc detail view and key management screen

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

* [INJIMOB-3622] fix: banner hidden inhelp screen

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

* [INJIMOB-3622] refactor: format VC detail view

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

* [INJIMOB-3637] fix extra header space across app screens

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

* [INJIMOB-3635]: updatd the pin background color to transparent

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

* [INJIMOB-3637] fix extra header space across app screens

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

* [INJIMOB-3565] fix: modal screen showing bottom tabs

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

* [INJIMOB-3565] fix: modal screen showing bottom tabs

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

* [INJIMOB-3635]: added the color back

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

* [INJIMOB-3565] fix: bottom tab bar overlaying the safe area

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

* [INJIMOB-3635]: updated failing snap shots

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

* [INJIMOB-3635]: cleared the icon issue

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

* [INJIMOB-3622]: cleared the scroll issue which is happening with vc view screen

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

* [INJIMOB-3622]: cleared the issues rised by code rabbit

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

* [INJIMOB-3565] fix: replace initialWindowMetrics padding with safe area insets

 initialWindowMetrics will be getting the data only on iniitial phase

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

* [INJIMOB-3635]: cleared the icon issue

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

* [INJIMOB-3565] fix: iOS notification bar not showing white bg

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

* [INJIMOB-3565] refactor: replace SafeAreaView import from react-native-safe-area-context

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

* [INJIMOB-3565] refactor: move SafeAreaProvider to root component

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

* [INJIMOB-3565] refactor: extract tab bar visibility setter to hook

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

* [INJIMOB-3565] refactor: optimize imports

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

* [INJIMOB-3565] refactor: revert fix - bottom tab visible in safe area on backup / restore screen

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

* [INJIMOB-3565] refactor: fix failing tests

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

* [INJIMOB-3622]: cleared the issues rised by banner bar

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

* [INJIMOB-3622] refactor: optimize import

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

* [INJIMOB-3622]: clear the jitpack issue

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

* [INJIMOB-3622] refactor: reove unused code

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

* [INJIMOB-3622] refactor: optimize import

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

* [INJIMOB-3622] refactor: remove jitpack github repo

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: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
Signed-off-by: jaswanthkumartw <jaswanthkumar.p@thoughtworks.com>
Co-authored-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
2025-11-19 00:15:46 +05:30

173 lines
5.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';
import {useSettingsScreen} from '../screens/Settings/SettingScreenController';
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 (
<View style={Theme.BannerStyles.bannerStackContainer}>
<BackupAndRestoreBannerNotification />
{settingsScreenController.isKeyOrderSet === true && (
<View>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('keyPreferenceSuccess')}
onClosePress={settingsScreenController.RESET_KEY_ORDER_RESPONSE}
key={'keyOrderingSuccess'}
testId={'keyOrderingSuccess'}
/>
</View>
)}
{settingsScreenController.isKeyOrderSet === false && (
<View>
<BannerNotification
type={BannerStatusType.ERROR}
message={t('keyPreferenceError')}
onClosePress={settingsScreenController.RESET_KEY_ORDER_RESPONSE}
key={'keyOrderingError'}
testId={'keyOrderingError'}
/>
</View>
)}
{WalletBindingSuccess && (
<View>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t('activated')}
onClosePress={
bannerNotificationController.RESET_WALLET_BINDING_SUCCESS
}
key={'activatedVcPopup'}
testId={'activatedVcPopup'}
/>
</View>
)}
{reverificationSuccessObject.status && (
<View>
<BannerNotification
type={BannerStatusType.SUCCESS}
message={t(
`reverifiedSuccessfully.${reverificationSuccessObject.statusValue}`,
{vcType: reverificationSuccessObject.vcType},
)}
onClosePress={
bannerNotificationController.RESET_REVIRIFICATION_SUCCESS
}
key={'reverifiedSuccessfullyPopup'}
testId={'reverifiedSuccessfullyPopup'}
/>
</View>
)}
{showQuickShareSuccessBanner && (
<View>
<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'}
/>
)}
</View>
);
};
export type vcVerificationBannerDetails = {
statusType: BannerStatus;
isRevoked: boolean;
isExpired: boolean;
vcType: string;
};
export interface BannerNotificationContainerProps {
showVerificationStatusBanner?: boolean;
}