Skip to content

Commit

Permalink
Shafin/bot 582/chore inform download btn disable reason (binary-com#1…
Browse files Browse the repository at this point in the history
…0526)

* 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
  • Loading branch information
shafin-deriv committed Oct 11, 2023
1 parent 1e73722 commit 5f0c28d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/bot-web-ui/src/components/download/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Popover
className='run-panel__info'
Expand Down

0 comments on commit 5f0c28d

Please sign in to comment.