-
-
Step {step + 1}
- {step > 0 && (
- setStep(step - 1)}
- >
- {t('global.back')}
-
- )}
-
-
- {balanceSummary && (
-
-
-
- setStep(1)}
- >
- {t('global.next')}
-
-
- )}
-
- {balanceSummary && selectedAccount && (
-
-
-
- setStep(2)}
- >
- {t('global.next')}
-
-
- setStep(0)}>
- {t('global.back')}
-
-
- )}
-
- {balanceSummary && selectedAccount && selectedLockdate && (
-
- {alert ? (
-
{alert.message}
- ) : (
- <>
- {timelockedDestinationAddress === null ? (
-
-
- {t('global.loading')}
-
- ) : (
-
- )}
- >
- )}
-
-
- userConfirmed &&
- timelockedDestinationAddress &&
- onSubmit(selectedAccount, selectedLockdate, timelockedDestinationAddress)
- }
- >
- {t('fidelity_bond.create_form.button_create')}
-
-
-
setStep(1)}>
- {t('global.back')}
-
-
- )}
-
- )
-}
-
-export default FidelityBondDetailsSetupForm
diff --git a/src/components/fidelity_bond/PercentageBar.module.css b/src/components/fidelity_bond/PercentageBar.module.css
deleted file mode 100644
index 9da599626..000000000
--- a/src/components/fidelity_bond/PercentageBar.module.css
+++ /dev/null
@@ -1,17 +0,0 @@
-.percentage-bar {
- position: absolute;
- height: 100%;
- background-color: rgba(22, 22, 22, 0.1);
-}
-
-:root[data-theme='dark'] .percentage-bar {
- background-color: rgba(222, 222, 222, 0.1);
-}
-
-.percentage-bar.highlight {
- background-color: rgba(39, 174, 96, 0.2);
-}
-
-:root[data-theme='dark'] .percentage-bar.highlight {
- background-color: rgba(39, 174, 96, 0.1);
-}
diff --git a/src/components/fidelity_bond/PercentageBar.tsx b/src/components/fidelity_bond/PercentageBar.tsx
deleted file mode 100644
index 28e9f2051..000000000
--- a/src/components/fidelity_bond/PercentageBar.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from 'react'
-import styles from './PercentageBar.module.css'
-
-interface PercentageBarProps {
- percentage: number
- highlight?: boolean
-}
-
-const PercentageBar = ({ percentage, highlight = false }: PercentageBarProps) => {
- return (
-
{utxo.address}
From 487df34fcbb60a29a9f5820ce4b534c25ae14a14 Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Tue, 5 Jul 2022 14:12:12 +0200
Subject: [PATCH 06/13] fix: dark mode fix
---
src/components/fb/ExistingFidelityBond.jsx | 2 +-
src/components/fb/ExistingFidelityBond.module.css | 4 ++++
src/components/fb/FidelityBondSteps.module.css | 4 ++++
src/components/fb/FidelityBondSteps.tsx | 2 +-
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/components/fb/ExistingFidelityBond.jsx b/src/components/fb/ExistingFidelityBond.jsx
index 69dd371e3..aeed60ce8 100644
--- a/src/components/fb/ExistingFidelityBond.jsx
+++ b/src/components/fb/ExistingFidelityBond.jsx
@@ -31,7 +31,7 @@ const ExistingFidelityBond = ({ utxo }) => {
}
- successText={
}
+ successText={
}
value={utxo.address}
className={styles.icon}
/>
diff --git a/src/components/fb/ExistingFidelityBond.module.css b/src/components/fb/ExistingFidelityBond.module.css
index cbbcd4756..0a96e8ce1 100644
--- a/src/components/fb/ExistingFidelityBond.module.css
+++ b/src/components/fb/ExistingFidelityBond.module.css
@@ -38,3 +38,7 @@
width: 18px;
height: 18px;
}
+
+.icon svg {
+ color: var(--bs-body-color);
+}
diff --git a/src/components/fb/FidelityBondSteps.module.css b/src/components/fb/FidelityBondSteps.module.css
index 708d86194..b177de6ab 100644
--- a/src/components/fb/FidelityBondSteps.module.css
+++ b/src/components/fb/FidelityBondSteps.module.css
@@ -153,6 +153,10 @@
height: 18px;
}
+.confirmationStepIcon svg {
+ color: var(--bs-body-color);
+}
+
.confirmationStepLabel {
color: var(--bs-gray-600);
font-size: 0.8rem;
diff --git a/src/components/fb/FidelityBondSteps.tsx b/src/components/fb/FidelityBondSteps.tsx
index dbbc0485d..e23236eac 100644
--- a/src/components/fb/FidelityBondSteps.tsx
+++ b/src/components/fb/FidelityBondSteps.tsx
@@ -258,7 +258,7 @@ const ReviewInputs = ({ lockDate, jar, utxos, selectedUtxos, timelockedAddress }
}
- successText={
}
+ successText={
}
value={timelockedAddress}
className={styles.confirmationStepIcon}
/>
From ab03dc27a72a5e33590d9930b99304cd86d37d5a Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Wed, 6 Jul 2022 10:11:04 +0200
Subject: [PATCH 07/13] fix: remove cj-out testing rig
---
src/components/fb/CreateFidelityBond.jsx | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/components/fb/CreateFidelityBond.jsx b/src/components/fb/CreateFidelityBond.jsx
index 01cc36271..6839e83e2 100644
--- a/src/components/fb/CreateFidelityBond.jsx
+++ b/src/components/fb/CreateFidelityBond.jsx
@@ -127,12 +127,6 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
const utxosByAccount = utxos.reduce((res, utxo) => {
const { mixdepth } = utxo
res[mixdepth] = res[mixdepth] || []
-
- // todo: remove
- if (utxo.value === 100000000) {
- utxo.label = 'cj-out'
- }
-
res[mixdepth].push(utxo)
return res
From 826e7f84c1d90d843bfda5363951f732309cc79d Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Wed, 6 Jul 2022 10:12:51 +0200
Subject: [PATCH 08/13] fix: typos
Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com>
---
src/components/fb/FidelityBondSteps.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/fb/FidelityBondSteps.tsx b/src/components/fb/FidelityBondSteps.tsx
index e23236eac..2d1ca59f0 100644
--- a/src/components/fb/FidelityBondSteps.tsx
+++ b/src/components/fb/FidelityBondSteps.tsx
@@ -239,7 +239,7 @@ const ReviewInputs = ({ lockDate, jar, utxos, selectedUtxos, timelockedAddress }
},
{
icon:
,
- label: 'Funds will be spend from',
+ label: 'Funds will be spent from',
content: `Jar #${jar}`,
},
{
@@ -263,7 +263,7 @@ const ReviewInputs = ({ lockDate, jar, utxos, selectedUtxos, timelockedAddress }
className={styles.confirmationStepIcon}
/>
),
- label: 'Funds will be lockd up on this address',
+ label: 'Funds will be locked up on this address',
content:
{timelockedAddress}
,
},
]
From 6a1f61677c4603b0b8d7d2380eb693628a5af42c Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Wed, 6 Jul 2022 10:27:20 +0200
Subject: [PATCH 09/13] review: resuse settings from parent
---
src/components/fb/FidelityBondSteps.tsx | 54 ++++++++++++-------------
1 file changed, 25 insertions(+), 29 deletions(-)
diff --git a/src/components/fb/FidelityBondSteps.tsx b/src/components/fb/FidelityBondSteps.tsx
index 2d1ca59f0..6e03f0f53 100644
--- a/src/components/fb/FidelityBondSteps.tsx
+++ b/src/components/fb/FidelityBondSteps.tsx
@@ -198,38 +198,34 @@ const FreezeUtxos = ({ jar, utxos, selectedUtxos, isLoading = false }: FreezeUtx
const ReviewInputs = ({ lockDate, jar, utxos, selectedUtxos, timelockedAddress }: ReviewInputsProps) => {
const settings = useSettings()
- const UtxoSummary = ({ title, icon, utxos }: { title: string; icon: string; utxos: Array
}) => {
- const settings = useSettings()
-
- return (
-
-
-
- {utxos.map((utxo, index) => (
-
-
-
-
-
- {utxo.label === 'cj-out' && (
-
-
- {utxo.label}
-
- )}
-
-
-
{utxo.address}
+ const UtxoSummary = ({ title, icon, utxos }: { title: string; icon: string; utxos: Array
}) => (
+
+
+
+ {utxos.map((utxo, index) => (
+
+
+
+
+ {utxo.label === 'cj-out' && (
+
+
+ {utxo.label}
+
+ )}
- ))}
-
+
+ {utxo.address}
+
+
+ ))}
- )
- }
+
+ )
const confirmationItems = [
{
From 82673f52c2d0bb7e68dc3ee4b9540ad41e1d79f0 Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Wed, 6 Jul 2022 12:06:41 +0200
Subject: [PATCH 10/13] review: hide balance on existing fidelity bond
---
src/components/fb/ExistingFidelityBond.jsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/components/fb/ExistingFidelityBond.jsx b/src/components/fb/ExistingFidelityBond.jsx
index aeed60ce8..3b98a91a8 100644
--- a/src/components/fb/ExistingFidelityBond.jsx
+++ b/src/components/fb/ExistingFidelityBond.jsx
@@ -14,7 +14,11 @@ const ExistingFidelityBond = ({ utxo }) => {
Fidelity Bond
-
+
From c7283136c71550152d84d05ec7f563c06dc986be Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Wed, 6 Jul 2022 12:21:05 +0200
Subject: [PATCH 11/13] review: clear alerts on successful requests
---
src/components/fb/CreateFidelityBond.jsx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/components/fb/CreateFidelityBond.jsx b/src/components/fb/CreateFidelityBond.jsx
index 6839e83e2..d4cc8e6ff 100644
--- a/src/components/fb/CreateFidelityBond.jsx
+++ b/src/components/fb/CreateFidelityBond.jsx
@@ -70,6 +70,7 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
await Promise.all(freezeCalls)
.then((_) => reloadCurrentWalletInfo({ signal: abortCtrl.signal }))
+ .then((_) => setAlert(null))
.catch((err) => {
setAlert({ variant: 'danger', message: err.message, dismissible: true })
})
@@ -93,6 +94,7 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
return res.ok ? res.json() : Api.Helper.throwError(res, 'fidelity_bond.error_loading_timelock_address_failed')
})
.then((data) => setTimelockedAddress(data.address))
+ .then((_) => setAlert(null))
.catch((err) => {
setAlert({ variant: 'danger', message: err.message })
})
@@ -115,6 +117,7 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
return Api.Helper.throwError(res, 'Could not create fidelity bond.')
}
})
+ .then((_) => setAlert(null))
.catch((err) => {
setAlert({ variant: 'danger', message: err.message })
})
From 38ee904635e15cdcd510a6e48d03768a5de6f3ca Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Wed, 6 Jul 2022 12:23:17 +0200
Subject: [PATCH 12/13] review: do not compress selection box
---
src/components/fb/FidelityBondSteps.module.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/components/fb/FidelityBondSteps.module.css b/src/components/fb/FidelityBondSteps.module.css
index b177de6ab..0062b9c60 100644
--- a/src/components/fb/FidelityBondSteps.module.css
+++ b/src/components/fb/FidelityBondSteps.module.css
@@ -47,6 +47,7 @@
display: flex;
align-items: center;
justify-content: center;
+ flex-shrink: 0;
}
:root[data-theme='dark'] .utxoCard > .utxoSelectionMarker {
From 9d58308f71304b77766636fde755dc2bf4dc9319 Mon Sep 17 00:00:00 2001
From: Daniel <10026790+dnlggr@users.noreply.github.com>
Date: Wed, 6 Jul 2022 13:39:17 +0200
Subject: [PATCH 13/13] review: fix promise code
---
src/components/fb/CreateFidelityBond.jsx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/components/fb/CreateFidelityBond.jsx b/src/components/fb/CreateFidelityBond.jsx
index d4cc8e6ff..df082268c 100644
--- a/src/components/fb/CreateFidelityBond.jsx
+++ b/src/components/fb/CreateFidelityBond.jsx
@@ -54,7 +54,7 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
setAlert(null)
}
- const freezeUtxos = async (utxos) => {
+ const freezeUtxos = (utxos) => {
setIsLoading(true)
const abortCtrl = new AbortController()
@@ -68,7 +68,7 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
})
)
- await Promise.all(freezeCalls)
+ Promise.all(freezeCalls)
.then((_) => reloadCurrentWalletInfo({ signal: abortCtrl.signal }))
.then((_) => setAlert(null))
.catch((err) => {
@@ -79,12 +79,12 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
})
}
- const loadTimeLockedAddress = async (lockDate) => {
+ const loadTimeLockedAddress = (lockDate) => {
setIsLoading(true)
const abortCtrl = new AbortController()
- await Api.getAddressTimelockNew({
+ Api.getAddressTimelockNew({
walletName: wallet.name,
token: wallet.token,
signal: abortCtrl.signal,
@@ -101,10 +101,10 @@ const CreateFidelityBond = ({ otherFidelityBondExists, accountBalances, totalBal
.finally(() => setIsLoading(false))
}
- const directSweepToFidelityBond = async (jar, address) => {
+ const directSweepToFidelityBond = (jar, address) => {
setIsLoading(true)
- await Api.postDirectSend(
+ Api.postDirectSend(
{ walletName: wallet.name, token: wallet.token },
{
mixdepth: jar,