From bc9e416356bd31415876dfab30cacf46d624f2ef Mon Sep 17 00:00:00 2001 From: Nischal Shetty Date: Wed, 6 Nov 2024 17:45:36 +0530 Subject: [PATCH 1/4] added note when freeze/unfreeze is disabled --- .../jar_details/JarDetailsOverlay.module.css | 6 ++++++ .../jar_details/JarDetailsOverlay.tsx | 17 +++++++++++++---- src/i18n/locales/en/translation.json | 3 ++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/jar_details/JarDetailsOverlay.module.css b/src/components/jar_details/JarDetailsOverlay.module.css index 772c8a078..1b4e50261 100644 --- a/src/components/jar_details/JarDetailsOverlay.module.css +++ b/src/components/jar_details/JarDetailsOverlay.module.css @@ -104,6 +104,11 @@ border-radius: 0.35rem; } +.freezeUnfreezeButtonsContainer button:disabled { + color: var(--bs-gray-800) !important; + border-color: var(--bs-gray-900) !important; +} + .freezeBtn { color: var(--bs-blue) !important; border-color: var(--bs-blue) !important; @@ -111,6 +116,7 @@ .freezeBtn:hover { background-color: rgba(13, 110, 253, 0.07) !important; } + .unfreezeBtn { color: var(--bs-red) !important; border-color: var(--bs-red) !important; diff --git a/src/components/jar_details/JarDetailsOverlay.tsx b/src/components/jar_details/JarDetailsOverlay.tsx index f1970d726..1a8a82a4c 100644 --- a/src/components/jar_details/JarDetailsOverlay.tsx +++ b/src/components/jar_details/JarDetailsOverlay.tsx @@ -373,12 +373,21 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => { {selectedUtxos.length > 0 && (
- {isActionsEnabled && ( -
- {freezeButton} - {unfreezeButton} + {!isActionsEnabled && ( +
+ +
)} +
+ {freezeButton} + {unfreezeButton} +
{selectedUtxosBalance > 0 && (
diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index d17449380..ea5d91302 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -719,7 +719,8 @@ "utxo_detail_label_confirmations": "Confirmations", "utxo_detail_label_is_frozen": "Is frozen", "utxo_detail_label_locktime": "Locktime", - "utxo_detail_label_status": "Address status" + "utxo_detail_label_status": "Address status", + "subtitle_options_disabled": "A Maker/Taker operation is in progress. Some operations are disabled" } }, "show_utxos": { From 8360ae0e997db6e969861e2078832239d44a69e1 Mon Sep 17 00:00:00 2001 From: Nischal Shetty Date: Wed, 6 Nov 2024 20:31:38 +0530 Subject: [PATCH 2/4] display note without selection,fixed dark mode bug --- .../jar_details/JarDetailsOverlay.module.css | 5 +++++ .../jar_details/JarDetailsOverlay.tsx | 22 +++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/components/jar_details/JarDetailsOverlay.module.css b/src/components/jar_details/JarDetailsOverlay.module.css index 1b4e50261..cc5214772 100644 --- a/src/components/jar_details/JarDetailsOverlay.module.css +++ b/src/components/jar_details/JarDetailsOverlay.module.css @@ -129,6 +129,11 @@ background-color: var(--bs-gray-800) !important; } +:root[data-theme='dark'] .freezeUnfreezeButtonsContainer button:disabled { + color: var(--bs-gray-400) !important; + border-color: var(--bs-gray-500) !important; +} + :root[data-theme='dark'] .freezeUnfreezeButtonsContainer button:hover { background-color: var(--bs-gray-900) !important; border-color: var(--bs-gray-900) !important; diff --git a/src/components/jar_details/JarDetailsOverlay.tsx b/src/components/jar_details/JarDetailsOverlay.tsx index 1a8a82a4c..447c8796a 100644 --- a/src/components/jar_details/JarDetailsOverlay.tsx +++ b/src/components/jar_details/JarDetailsOverlay.tsx @@ -370,20 +370,20 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => {
+ {!isActionsEnabled && ( +
+ + +
+ )} {selectedUtxos.length > 0 && (
- {!isActionsEnabled && ( -
- - -
- )}
{freezeButton} {unfreezeButton} From 89ed926c8dd0a74609784bec8698b43ad6759f2a Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Thu, 7 Nov 2024 15:19:31 +0100 Subject: [PATCH 3/4] ui(JarDetailsView): normal font for disabled info text --- src/components/jar_details/JarDetailsOverlay.tsx | 4 ++-- src/i18n/locales/en/translation.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/jar_details/JarDetailsOverlay.tsx b/src/components/jar_details/JarDetailsOverlay.tsx index 447c8796a..b79db5f2b 100644 --- a/src/components/jar_details/JarDetailsOverlay.tsx +++ b/src/components/jar_details/JarDetailsOverlay.tsx @@ -371,14 +371,14 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => {
{!isActionsEnabled && ( -
+
- +
)} {selectedUtxos.length > 0 && ( diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index ea5d91302..40931a9f2 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -720,7 +720,7 @@ "utxo_detail_label_is_frozen": "Is frozen", "utxo_detail_label_locktime": "Locktime", "utxo_detail_label_status": "Address status", - "subtitle_options_disabled": "A Maker/Taker operation is in progress. Some operations are disabled" + "text_actions_disabled": "A maker or taker operation is in progress. Some operations are disabled." } }, "show_utxos": { From dad8b573734f5e90834a03486e97421ec55dbc1d Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Thu, 7 Nov 2024 15:28:08 +0100 Subject: [PATCH 4/4] 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": {