Skip to content

Commit

Permalink
[WALL] george / WALL-5235 / Notification Missing on Trader’s Hub Page…
Browse files Browse the repository at this point in the history
… for Wallet Accounts (#17802)

* feat: enhance RootComponent and App to include notification messages UI

* fix: update notifications display logic in App component
  • Loading branch information
heorhi-deriv authored Dec 16, 2024
1 parent 04c01f0 commit 480b55c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ const Wallets = React.lazy(() =>

const RootComponent = observer(props => {
const { client, ui } = useStore();
const { is_wallets_onboarding_tour_guide_visible, setIsWalletsOnboardingTourGuideVisible } = ui;
const {
is_wallets_onboarding_tour_guide_visible,
setIsWalletsOnboardingTourGuideVisible,
notification_messages_ui,
} = ui;
const { has_wallet, logout } = client;

const { oAuthLogout } = useOauth2({ handleLogout: logout });
Expand All @@ -35,6 +39,7 @@ const RootComponent = observer(props => {
logout={async () => {
await oAuthLogout();
}}
notificationMessagesUi={notification_messages_ui}
onWalletsOnboardingTourGuideCloseHandler={onWalletsOnboardingTourGuideCloseHandler}
/>
) : (
Expand Down
8 changes: 8 additions & 0 deletions packages/wallets/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import './index.scss';
type TProps = {
isWalletsOnboardingTourGuideVisible: boolean;
logout: () => Promise<void>;
notificationMessagesUi: (props?: {
is_mt5?: boolean;
is_notification_loaded?: boolean;
show_trade_notifications?: boolean;
stopNotificationLoading?: VoidFunction;
}) => JSX.Element;
onWalletsOnboardingTourGuideCloseHandler: VoidFunction;
};

Expand All @@ -21,6 +27,7 @@ const LazyWalletTourGuide = lazy(() => import('./components/WalletTourGuide/Wall
const App: React.FC<TProps> = ({
isWalletsOnboardingTourGuideVisible,
logout,
notificationMessagesUi: Notifications,
onWalletsOnboardingTourGuideCloseHandler,
}) => {
const [preferredLanguage, setPreferredLanguage] = useState<TLanguageType | null>(null);
Expand All @@ -42,6 +49,7 @@ const App: React.FC<TProps> = ({
<TranslationProvider defaultLang={defaultLanguage} i18nInstance={i18nInstance}>
<React.Suspense fallback={<Loader />}>
<ModalProvider>
{!isWalletsOnboardingTourGuideVisible && Notifications && <Notifications />}
<AppContent
isWalletsOnboardingTourGuideVisible={isWalletsOnboardingTourGuideVisible}
setPreferredLanguage={setPreferredLanguage}
Expand Down

0 comments on commit 480b55c

Please sign in to comment.