Skip to content

Commit

Permalink
wip(renew): add renew button to expired fb
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Oct 14, 2023
1 parent 2bed51e commit ea71238
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
32 changes: 20 additions & 12 deletions src/components/Earn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ export default function Earn({ wallet }: EarnProps) {
}, [currentWalletInfo])

const [moveToJarFidelityBondId, setMoveToJarFidelityBondId] = useState<Api.UtxoId>()
const [renewFidelityBondId, setRenewFidelityBondId] = useState<Api.UtxoId>()

const startMakerService = useCallback(
(values: EarnFormValues) => {
Expand Down Expand Up @@ -645,18 +646,25 @@ export default function Earn({ wallet }: EarnProps) {
return (
<ExistingFidelityBond key={index} fidelityBond={fidelityBond}>
{actionsEnabled && (
<div className="mt-4">
<div className="">
<rb.Button
variant={settings.theme === 'dark' ? 'light' : 'dark'}
className="w-50 d-flex justify-content-center align-items-center"
disabled={moveToJarFidelityBondId !== undefined}
onClick={() => setMoveToJarFidelityBondId(fidelityBond.utxo)}
>
<Sprite className="me-1 mb-1" symbol="unlock" width="24" height="24" />
{t('earn.fidelity_bond.existing.button_spend')}
</rb.Button>
</div>
<div className="mt-4 d-flex gap-2">
<rb.Button
variant={settings.theme === 'dark' ? 'light' : 'dark'}
className="w-100 d-flex justify-content-center align-items-center"
disabled={moveToJarFidelityBondId !== undefined}
onClick={() => setMoveToJarFidelityBondId(fidelityBond.utxo)}
>
<Sprite className="me-1 mb-1" symbol="unlock" width="24" height="24" />
{t('earn.fidelity_bond.existing.button_spend')}
</rb.Button>
<rb.Button
variant={settings.theme === 'dark' ? 'light' : 'dark'}
className="w-100 d-flex justify-content-center align-items-center"
disabled={renewFidelityBondId !== undefined}
onClick={() => setRenewFidelityBondId(fidelityBond.utxo)}
>
<Sprite className="me-1" symbol="refresh" width="24" height="24" />
{t('earn.fidelity_bond.existing.button_renew')}
</rb.Button>
</div>
)}
</ExistingFidelityBond>
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@
"label_locked_until": "Locked until",
"label_expired_on": "Expired on",
"label_address": "Timelocked address",
"button_spend": "Unlock Funds"
"button_spend": "Unlock Funds",
"button_renew": "Renew Bond"
},
"move": {
"title": "Unlock Funds",
Expand Down

0 comments on commit ea71238

Please sign in to comment.