From dad8b573734f5e90834a03486e97421ec55dbc1d Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Thu, 7 Nov 2024 15:28:08 +0100 Subject: [PATCH] ui(JarDetailView): add explanation for disabled actions --- .../jar_details/JarDetailsOverlay.tsx | 17 ++++++++++++++--- src/i18n/locales/en/translation.json | 4 +++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/jar_details/JarDetailsOverlay.tsx b/src/components/jar_details/JarDetailsOverlay.tsx index b79db5f2b..c97b0256f 100644 --- a/src/components/jar_details/JarDetailsOverlay.tsx +++ b/src/components/jar_details/JarDetailsOverlay.tsx @@ -99,9 +99,12 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => { const settings = useSettings() const reloadCurrentWalletInfo = useReloadCurrentWalletInfo() const serviceInfo = useServiceInfo() + + const isCoinjoinInProgress = useMemo(() => serviceInfo?.coinjoinInProgress === true, [serviceInfo]) + const isMakerRunning = useMemo(() => serviceInfo?.makerRunning === true, [serviceInfo]) const isTakerOrMakerRunning = useMemo( - () => serviceInfo && (serviceInfo.makerRunning || serviceInfo.coinjoinInProgress), - [serviceInfo], + () => isCoinjoinInProgress || isMakerRunning, + [isCoinjoinInProgress, isMakerRunning], ) const [alert, setAlert] = useState() @@ -378,7 +381,15 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => { width="20" height="20" /> - + {isCoinjoinInProgress && ( + + )} + {isMakerRunning && ( + + )} + {!isMakerRunning && !isCoinjoinInProgress && ( + + )} )} {selectedUtxos.length > 0 && ( diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 40931a9f2..eecb38026 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -720,7 +720,9 @@ "utxo_detail_label_is_frozen": "Is frozen", "utxo_detail_label_locktime": "Locktime", "utxo_detail_label_status": "Address status", - "text_actions_disabled": "A maker or taker operation is in progress. Some operations are disabled." + "text_actions_disabled": "Some operations are disabled.", + "text_actions_disabled_maker_running": "Earn is active. Some operations are disabled.", + "text_actions_disabled_taker_running": "A collaborative transaction is currently in progress. Some operations are disabled." } }, "show_utxos": {