Skip to content

Commit fd94d4d

Browse files
committed
feat: enhance RootComponent and App to include notification messages UI
1 parent d8a54db commit fd94d4d

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

packages/core/src/App/Containers/RootComponent/root-component.jsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
2-
import { moduleLoader } from '@deriv/shared';
2+
33
import { useOauth2 } from '@deriv/hooks';
4+
import { moduleLoader } from '@deriv/shared';
45
import { observer, useStore } from '@deriv/stores';
56

67
const AppStore = React.lazy(() =>
@@ -19,7 +20,11 @@ const Wallets = React.lazy(() =>
1920

2021
const RootComponent = observer(props => {
2122
const { client, ui } = useStore();
22-
const { is_wallets_onboarding_tour_guide_visible, setIsWalletsOnboardingTourGuideVisible } = ui;
23+
const {
24+
is_wallets_onboarding_tour_guide_visible,
25+
setIsWalletsOnboardingTourGuideVisible,
26+
notification_messages_ui,
27+
} = ui;
2328
const { has_wallet, logout } = client;
2429

2530
const { oAuthLogout } = useOauth2({ handleLogout: logout });
@@ -34,6 +39,7 @@ const RootComponent = observer(props => {
3439
logout={async () => {
3540
await oAuthLogout();
3641
}}
42+
notificationMessagesUi={notification_messages_ui}
3743
onWalletsOnboardingTourGuideCloseHandler={onWalletsOnboardingTourGuideCloseHandler}
3844
/>
3945
) : (

packages/wallets/src/App.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ import './index.scss';
1313
type TProps = {
1414
isWalletsOnboardingTourGuideVisible: boolean;
1515
logout: () => Promise<void>;
16+
notificationMessagesUi: (props?: {
17+
is_mt5?: boolean;
18+
is_notification_loaded?: boolean;
19+
show_trade_notifications?: boolean;
20+
stopNotificationLoading?: VoidFunction;
21+
}) => JSX.Element;
1622
onWalletsOnboardingTourGuideCloseHandler: VoidFunction;
1723
};
1824

@@ -21,6 +27,7 @@ const LazyWalletTourGuide = lazy(() => import('./components/WalletTourGuide/Wall
2127
const App: React.FC<TProps> = ({
2228
isWalletsOnboardingTourGuideVisible,
2329
logout,
30+
notificationMessagesUi: Notifications,
2431
onWalletsOnboardingTourGuideCloseHandler,
2532
}) => {
2633
const [preferredLanguage, setPreferredLanguage] = useState<TLanguageType | null>(null);
@@ -42,6 +49,7 @@ const App: React.FC<TProps> = ({
4249
<TranslationProvider defaultLang={defaultLanguage} i18nInstance={i18nInstance}>
4350
<React.Suspense fallback={<Loader />}>
4451
<ModalProvider>
52+
{Notifications && <Notifications />}
4553
<AppContent
4654
isWalletsOnboardingTourGuideVisible={isWalletsOnboardingTourGuideVisible}
4755
setPreferredLanguage={setPreferredLanguage}

0 commit comments

Comments
 (0)