Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a note when freeze/unfreeze is disabled in Jar Details View #869

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/jar_details/JarDetailsOverlay.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,19 @@
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;
}
.freezeBtn:hover {
background-color: rgba(13, 110, 253, 0.07) !important;
}

.unfreezeBtn {
color: var(--bs-red) !important;
border-color: var(--bs-red) !important;
Expand All @@ -123,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;
Expand Down
36 changes: 28 additions & 8 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 @@ -370,15 +373,32 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => {
</Trans>
</div>
</div>
{!isActionsEnabled && (
<div className="d-flex align-items-center mb-2 px-2 text-secondary">
<Sprite
className="rounded-circle border border-1 me-2 border-secondary"
symbol="info"
width="20"
height="20"
/>
{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 && (
<div className="d-flex justify-content-between align-items-center w-100 flex-sm-row flex-column gap-2">
<div className="order-1 order-sm-0">
{isActionsEnabled && (
<div className={styles.freezeUnfreezeButtonsContainer}>
{freezeButton}
{unfreezeButton}
</div>
)}
<div className={styles.freezeUnfreezeButtonsContainer}>
{freezeButton}
{unfreezeButton}
</div>
</div>
{selectedUtxosBalance > 0 && (
<div className="order-0 order-sm-1">
Expand Down
5 changes: 4 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,10 @@
"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",
"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