From d9729b732d08a6b9dc4c63c2e8ccfeeb92014f24 Mon Sep 17 00:00:00 2001 From: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com> Date: Fri, 17 Feb 2023 11:51:43 +0800 Subject: [PATCH] thisyahlen/fix: add back notifications in traders hub (#7603) * fix: add back notifications in traders hub * fix: notification blinking * fix: move notifications up a bit in traders hub --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> --- .../appstore/src/modules/traders-hub/index.tsx | 4 +++- .../App/Containers/app-notification-messages.jsx | 15 +++++++++++++-- .../components/app-notification-message.scss | 4 ++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/appstore/src/modules/traders-hub/index.tsx b/packages/appstore/src/modules/traders-hub/index.tsx index 7d29ecd3e12c..78bdba33b68a 100644 --- a/packages/appstore/src/modules/traders-hub/index.tsx +++ b/packages/appstore/src/modules/traders-hub/index.tsx @@ -15,7 +15,8 @@ import classNames from 'classnames'; import './traders-hub.scss'; const TradersHub = () => { - const { traders_hub, client } = useStores(); + const { traders_hub, client, ui } = useStores(); + const { notification_messages_ui: Notifications } = ui; const { is_landing_company_loaded, is_logged_in } = client; const { selected_platform_type, setTogglePlatformType, is_tour_open, content_flag, is_eu_user } = traders_hub; const traders_hub_ref = React.useRef() as React.MutableRefObject; @@ -79,6 +80,7 @@ const TradersHub = () => { height_offset='50px' is_disabled={isDesktop()} > +
diff --git a/packages/core/src/App/Containers/app-notification-messages.jsx b/packages/core/src/App/Containers/app-notification-messages.jsx index 53bd01bc3c9e..4ec4902e838f 100644 --- a/packages/core/src/App/Containers/app-notification-messages.jsx +++ b/packages/core/src/App/Containers/app-notification-messages.jsx @@ -10,6 +10,7 @@ import Notification, { max_display_notifications_mobile, } from '../Components/Elements/NotificationMessage'; import 'Sass/app/_common/components/app-notification-message.scss'; +import classNames from 'classnames'; const Portal = ({ children }) => isMobile() ? ReactDOM.createPortal(children, document.getElementById('deriv_app')) : children; @@ -17,6 +18,7 @@ const Portal = ({ children }) => const NotificationsContent = ({ is_notification_loaded, style, + is_pre_appstore, notifications, removeNotificationMessage, markNotificationMessage, @@ -41,11 +43,16 @@ const NotificationsContent = ({ }, [window_location]); return ( -
+
{notifications.map(notification => (
@@ -196,6 +205,7 @@ AppNotificationMessages.propTypes = { removeNotificationMessage: PropTypes.func, should_show_popups: PropTypes.bool, stopNotificationLoading: PropTypes.func, + is_pre_appstore: PropTypes.bool, }; export default connect(({ client, notifications }) => ({ @@ -208,4 +218,5 @@ export default connect(({ client, notifications }) => ({ has_malta_account: client.has_malta_account, is_logged_in: client.is_logged_in, should_show_popups: notifications.should_show_popups, + is_pre_appstore: client.is_pre_appstore, }))(AppNotificationMessages); diff --git a/packages/core/src/sass/app/_common/components/app-notification-message.scss b/packages/core/src/sass/app/_common/components/app-notification-message.scss index 04c48ebaa180..c67fc8c18d59 100644 --- a/packages/core/src/sass/app/_common/components/app-notification-message.scss +++ b/packages/core/src/sass/app/_common/components/app-notification-message.scss @@ -16,6 +16,10 @@ left: 1.6rem; right: 1.6rem; } + + &--traders-hub { + margin: 1rem 1rem 0 0; + } } /** @define notification; weak */