From 970afc80a0d0a55367cb31cd6ab6cb9752c1b686 Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Wed, 7 Jan 2026 20:56:48 +0100 Subject: [PATCH] chore(earn): add create fidelity bond call to action --- src/components/earn/EarnPage.tsx | 99 +++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 28 deletions(-) diff --git a/src/components/earn/EarnPage.tsx b/src/components/earn/EarnPage.tsx index b604e691..a7dff53d 100644 --- a/src/components/earn/EarnPage.tsx +++ b/src/components/earn/EarnPage.tsx @@ -10,6 +10,7 @@ import { useStore } from 'zustand' import { FeeLimitDialog } from '@/components/settings/FeeLimitDialog' import { Button } from '@/components/ui/button' import { FeeConfigErrorAlert } from '@/components/ui/jam/FeeConfigErrorAlert' +import { isDevMode } from '@/constants/debugFeatures' import { useJamWalletInfoContext } from '@/context/JamWalletInfoContext' import { useApiClient } from '@/hooks/useApiClient' import { useFeeConfigValidation } from '@/hooks/useFeeConfigValidation' @@ -19,7 +20,9 @@ import { cn, isAbsoluteOffer, isRelativeOffer, percentageToFactor } from '@/lib/ import type { WalletFileName } from '@/lib/utils' import { jmSessionStore } from '@/store/jmSessionStore' import type { Milliseconds } from '@/types/global' +import { DevBadge } from '../dev/DevBadge' import { Alert, AlertDescription, AlertTitle } from '../ui/alert' +import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../ui/card' import { EarnForm, type EarnFormValues } from './EarnForm' import { FidelityBondCard } from './FidelityBondCard' import { OfferCard } from './OfferCard' @@ -189,19 +192,6 @@ export const EarnPage = ({ walletFileName }: EarnPageProps) => { setShowFeeConfigDialog(true)} className="mb-4" /> )} - - - Under construction - - Not yet completely implemented. - {maxFeesConfigMissing && ( - - Note: Fee configuration is required before earning with collaborative transactions. - - )} - - - {jmSessionState.maker_running === true && ( @@ -234,22 +224,57 @@ export const EarnPage = ({ walletFileName }: EarnPageProps) => { )} -

- {t('earn.title_fidelity_bonds', { count: walletInfo.fidelityBondSummary.fbOutputs.length })} -

-

{t('earn.subtitle_fidelity_bonds')}

+
+

+ {t('earn.title_fidelity_bonds', { count: walletInfo.fidelityBondSummary.fbOutputs.length })} +

+

{t('earn.subtitle_fidelity_bonds')}

- {walletInfo.fidelityBondSummary.fbOutputs.length > 0 ? ( -
- {walletInfo.fidelityBondSummary.fbOutputs.map((it, index) => ( - <> - - - ))} -
- ) : ( - <>{/*No fidelity bonds*/} - )} + {walletInfo.fidelityBondSummary.fbOutputs.length > 0 ? ( +
+ {walletInfo.fidelityBondSummary.fbOutputs.map((it, index) => ( + <> + + + ))} +
+ ) : ( + <> + {/*No fidelity bonds*/} + + + {t('earn.fidelity_bond.title')} + {t('earn.fidelity_bond.subtitle')} + + + + + + Under construction + Not yet completely implemented. + + + + + + + + + )} +
{ onOpenChange={setShowFeeConfigDialog} walletFileName={walletFileName} /> + + {isDevMode() && ( + + + + + +
+ walletInfo.fidelityBondSummary.fbOutputs: +
{JSON.stringify(walletInfo.fidelityBondSummary.fbOutputs, null, 2)}
+
+
+ jmSessionState.offer_list: +
{JSON.stringify(jmSessionState.offer_list, null, 2)}
+
+
+
+ )} ) }