From fec439fbdcb64f35f984d80d05545fe0eae91802 Mon Sep 17 00:00:00 2001 From: Farabi Chowdhury Date: Fri, 10 May 2024 12:21:24 +0800 Subject: [PATCH 1/5] fix: notification visibility and qs form alignment --- .../bot-notification/bot-notification-utils.ts | 2 +- .../bot-notification/bot-notification.tsx | 13 +++++++++++++ .../bot-builder/quick-strategy/quick-strategy.scss | 8 ++++---- .../pages/bot-builder/toolbar/workspace-group.tsx | 2 +- .../bot-web-ui/src/pages/dashboard/dashboard.scss | 3 --- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/packages/bot-web-ui/src/components/bot-notification/bot-notification-utils.ts b/packages/bot-web-ui/src/components/bot-notification/bot-notification-utils.ts index 4fea10f2bf16..50c5b487265a 100644 --- a/packages/bot-web-ui/src/components/bot-notification/bot-notification-utils.ts +++ b/packages/bot-web-ui/src/components/bot-notification/bot-notification-utils.ts @@ -1,6 +1,6 @@ import { toast, ToastPosition, TypeOptions } from 'react-toastify'; -import { localize } from '@deriv/translations'; import { isDbotRTL } from '@deriv/bot-skeleton/src/utils/workspace'; +import { localize } from '@deriv/translations'; const getToastPosition = () => { const is_RTL = isDbotRTL(); diff --git a/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx b/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx index db54658679ea..0c8be92f4754 100644 --- a/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx +++ b/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx @@ -3,6 +3,19 @@ import { toast } from 'react-toastify'; import { notification_style, TAction, TNotificationContent, TNotificationStyle } from './bot-notification-utils'; export const NotificationContent: React.FC = ({ message, primary_action, closeToast }) => { + React.useEffect(() => { + const handleVisibilityChange = () => { + if (document.visibilityState === 'hidden') { + toast.dismiss(); + } + }; + + document.addEventListener('visibilitychange', handleVisibilityChange); + + return () => { + document.removeEventListener('visibilitychange', handleVisibilityChange); + }; + }, []); return (
{message}
diff --git a/packages/bot-web-ui/src/pages/bot-builder/quick-strategy/quick-strategy.scss b/packages/bot-web-ui/src/pages/bot-builder/quick-strategy/quick-strategy.scss index 7b497736bdb1..fd3bf7f149a3 100644 --- a/packages/bot-web-ui/src/pages/bot-builder/quick-strategy/quick-strategy.scss +++ b/packages/bot-web-ui/src/pages/bot-builder/quick-strategy/quick-strategy.scss @@ -357,8 +357,8 @@ flex-direction: row-reverse; @include mobile() { - top: -2.8rem; - right: 4rem; + top: -2.6rem; + right: 5rem; } .dc-text { @@ -537,11 +537,11 @@ &__trailing-icon { @extend .seddle-actions; - right: 0.3rem; + right: 1rem; color: var(--text-general); @include mobile() { - right: 0.2rem; + right: 1.6rem; } &:hover { diff --git a/packages/bot-web-ui/src/pages/bot-builder/toolbar/workspace-group.tsx b/packages/bot-web-ui/src/pages/bot-builder/toolbar/workspace-group.tsx index 266a6c4dacf7..f40c0c77fef9 100644 --- a/packages/bot-web-ui/src/pages/bot-builder/toolbar/workspace-group.tsx +++ b/packages/bot-web-ui/src/pages/bot-builder/toolbar/workspace-group.tsx @@ -57,7 +57,7 @@ const WorkspaceGroup = observer(() => { setTradingViewModalVisibility()} diff --git a/packages/bot-web-ui/src/pages/dashboard/dashboard.scss b/packages/bot-web-ui/src/pages/dashboard/dashboard.scss index 381208eb5e4a..a45eeced0788 100644 --- a/packages/bot-web-ui/src/pages/dashboard/dashboard.scss +++ b/packages/bot-web-ui/src/pages/dashboard/dashboard.scss @@ -385,9 +385,6 @@ text-align: center; } } - &:nth-last-child(2) { - padding-inline: 0; - } } &__images { From ce3ea406c125adaef07de0edee1a1fe1b679f8f2 Mon Sep 17 00:00:00 2001 From: Farabi Chowdhury Date: Fri, 10 May 2024 12:29:48 +0800 Subject: [PATCH 2/5] chore: update toast visibility handler --- .../src/components/bot-notification/bot-notification.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx b/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx index 0c8be92f4754..4c56742f78c6 100644 --- a/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx +++ b/packages/bot-web-ui/src/components/bot-notification/bot-notification.tsx @@ -4,18 +4,19 @@ import { notification_style, TAction, TNotificationContent, TNotificationStyle } export const NotificationContent: React.FC = ({ message, primary_action, closeToast }) => { React.useEffect(() => { - const handleVisibilityChange = () => { + const handleToastVisibility = () => { if (document.visibilityState === 'hidden') { toast.dismiss(); } }; - document.addEventListener('visibilitychange', handleVisibilityChange); + document.addEventListener('visibilitychange', handleToastVisibility); return () => { - document.removeEventListener('visibilitychange', handleVisibilityChange); + document.removeEventListener('visibilitychange', handleToastVisibility); }; }, []); + return (
{message}
From a4dd54213464b3f8e54047b4b3682f0458551850 Mon Sep 17 00:00:00 2001 From: Farabi Chowdhury Date: Fri, 10 May 2024 17:01:49 +0800 Subject: [PATCH 3/5] fix: summary and transactions view detail for different language --- packages/bot-web-ui/src/components/download/download.scss | 4 ++++ .../bot-web-ui/src/components/run-panel/run-panel.scss | 8 ++++++++ .../src/components/transactions/transactions.scss | 2 ++ 3 files changed, 14 insertions(+) diff --git a/packages/bot-web-ui/src/components/download/download.scss b/packages/bot-web-ui/src/components/download/download.scss index 2de887754279..80167b95fa22 100644 --- a/packages/bot-web-ui/src/components/download/download.scss +++ b/packages/bot-web-ui/src/components/download/download.scss @@ -5,4 +5,8 @@ padding-left: 16px; border: solid 1px var(--general-section-1); } + + &__button { + padding: 2rem 1.6rem; + } } diff --git a/packages/bot-web-ui/src/components/run-panel/run-panel.scss b/packages/bot-web-ui/src/components/run-panel/run-panel.scss index 22a9ef8b03be..4c3eec1b54d9 100644 --- a/packages/bot-web-ui/src/components/run-panel/run-panel.scss +++ b/packages/bot-web-ui/src/components/run-panel/run-panel.scss @@ -102,6 +102,14 @@ justify-content: space-between; flex-direction: column; overflow: hidden !important; + + .dc-tabs { + &__item { + overflow: hidden; + text-overflow: ellipsis; + padding: 0 0.8rem; + } + } } &__buttons { display: inline-flex !important; diff --git a/packages/bot-web-ui/src/components/transactions/transactions.scss b/packages/bot-web-ui/src/components/transactions/transactions.scss index 7de163f547a2..25e33c517dea 100644 --- a/packages/bot-web-ui/src/components/transactions/transactions.scss +++ b/packages/bot-web-ui/src/components/transactions/transactions.scss @@ -8,6 +8,8 @@ .download__container { &__view-detail-button { margin-inline-start: 12px; + white-space: unset; + padding: 2rem 1.6rem; } } From 0159ae7dacfe8c472ab353d30f3953f847f051e8 Mon Sep 17 00:00:00 2001 From: Farabi Chowdhury Date: Fri, 10 May 2024 17:47:10 +0800 Subject: [PATCH 4/5] chore: removed download and view detail icon --- packages/bot-web-ui/src/components/download/download.scss | 4 ---- packages/bot-web-ui/src/components/download/download.tsx | 3 --- .../bot-web-ui/src/components/transactions/transactions.scss | 2 -- .../bot-web-ui/src/components/transactions/transactions.tsx | 1 - 4 files changed, 10 deletions(-) diff --git a/packages/bot-web-ui/src/components/download/download.scss b/packages/bot-web-ui/src/components/download/download.scss index 80167b95fa22..2de887754279 100644 --- a/packages/bot-web-ui/src/components/download/download.scss +++ b/packages/bot-web-ui/src/components/download/download.scss @@ -5,8 +5,4 @@ padding-left: 16px; border: solid 1px var(--general-section-1); } - - &__button { - padding: 2rem 1.6rem; - } } diff --git a/packages/bot-web-ui/src/components/download/download.tsx b/packages/bot-web-ui/src/components/download/download.tsx index 543e21063032..d3d36cabd3c8 100644 --- a/packages/bot-web-ui/src/components/download/download.tsx +++ b/packages/bot-web-ui/src/components/download/download.tsx @@ -96,9 +96,6 @@ const Download = observer(({ tab }: TDownloadProps) => { id='download-button' is_disabled={disabled} className='download__button' - icon={ - - } text={localize('Download')} onClick={clickFunction} secondary diff --git a/packages/bot-web-ui/src/components/transactions/transactions.scss b/packages/bot-web-ui/src/components/transactions/transactions.scss index 25e33c517dea..7de163f547a2 100644 --- a/packages/bot-web-ui/src/components/transactions/transactions.scss +++ b/packages/bot-web-ui/src/components/transactions/transactions.scss @@ -8,8 +8,6 @@ .download__container { &__view-detail-button { margin-inline-start: 12px; - white-space: unset; - padding: 2rem 1.6rem; } } diff --git a/packages/bot-web-ui/src/components/transactions/transactions.tsx b/packages/bot-web-ui/src/components/transactions/transactions.tsx index 8b24958fabe8..b3882ef26913 100644 --- a/packages/bot-web-ui/src/components/transactions/transactions.tsx +++ b/packages/bot-web-ui/src/components/transactions/transactions.tsx @@ -115,7 +115,6 @@ const Transactions = observer(({ is_drawer_open }: TTransactions) => { toggleTransactionDetailsModal(true); }} secondary - icon={} />
From 155b6c294492a3eb00c54acb5d616588fbba9e26 Mon Sep 17 00:00:00 2001 From: Farabi Chowdhury Date: Tue, 14 May 2024 15:24:46 +0800 Subject: [PATCH 5/5] fix: transaction panel profit alignment --- .../bot-web-ui/src/components/transactions/transactions.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bot-web-ui/src/components/transactions/transactions.scss b/packages/bot-web-ui/src/components/transactions/transactions.scss index 7de163f547a2..62b846b9035b 100644 --- a/packages/bot-web-ui/src/components/transactions/transactions.scss +++ b/packages/bot-web-ui/src/components/transactions/transactions.scss @@ -77,7 +77,7 @@ text-align: start; } @if $item == 'profit' { - text-align: end; + text-align: start; } } }