From 5f0c28dbd034203ee0843f439beb20e3e396d7e6 Mon Sep 17 00:00:00 2001 From: Shafin Al Karim <129021108+shafin-deriv@users.noreply.github.com> Date: Wed, 11 Oct 2023 22:47:33 +0800 Subject: [PATCH] Shafin/bot 582/chore inform download btn disable reason (#10526) * chore: add reason for download button disable state * chore: write test case for FilterDialog * chore: remove the unnecessary test case from this branch * fix: message should show for both journal and transaction * fix: separate empty disable message for journal and transactions --- packages/bot-web-ui/src/components/download/download.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/bot-web-ui/src/components/download/download.tsx b/packages/bot-web-ui/src/components/download/download.tsx index 026871ebde8d..3a4fce892957 100644 --- a/packages/bot-web-ui/src/components/download/download.tsx +++ b/packages/bot-web-ui/src/components/download/download.tsx @@ -17,13 +17,17 @@ const Download = observer(({ tab }: TDownloadProps) => { let clickFunction, popover_message; if (tab === 'transactions') { clickFunction = onClickDownloadTransaction; - popover_message = localize('Download your transaction history.'); disabled = !transaction_list.length || is_running; + popover_message = localize('Download your transaction history.'); + if (!transaction_list.length) popover_message = localize('No transaction or activity yet.'); } else if (tab === 'journal') { clickFunction = onClickDownloadJournal; popover_message = localize('Download your journal.'); disabled = is_clear_stat_disabled; + if (disabled) popover_message = localize('No transaction or activity yet.'); } + if (is_running) popover_message = localize('Download is unavailable while your bot is running.'); + return (