Skip to content

Commit

Permalink
ui(JarDetailView): add explanation for disabled actions
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Nov 7, 2024
1 parent 89ed926 commit dad8b57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/components/jar_details/JarDetailsOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<SimpleAlert>()
Expand Down Expand Up @@ -378,7 +381,15 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => {
width="20"
height="20"
/>
<Trans i18nKey="jar_details.utxo_list.text_actions_disabled" />
{isCoinjoinInProgress && (
<Trans i18nKey="jar_details.utxo_list.text_actions_disabled_taker_running" />
)}
{isMakerRunning && (
<Trans i18nKey="jar_details.utxo_list.text_actions_disabled_maker_running" />
)}
{!isMakerRunning && !isCoinjoinInProgress && (
<Trans i18nKey="jar_details.utxo_list.text_actions_disabled" />
)}
</div>
)}
{selectedUtxos.length > 0 && (
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit dad8b57

Please sign in to comment.