diff --git a/src/components/composite/Hero.tsx b/src/components/composite/Hero.tsx index 2cc2607..b62b002 100644 --- a/src/components/composite/Hero.tsx +++ b/src/components/composite/Hero.tsx @@ -51,34 +51,24 @@ export default function Hero({ + }}> - {breadcrumbs?.map((breadcrumb) => { + {breadcrumbs?.map(breadcrumb => { if (breadcrumb.component) return <>{breadcrumb.component}; return ( - @@ -92,14 +82,14 @@ export default function Hero({ {!!icons && ( {icons?.length > 1 - ? icons?.map((icon) => ( + ? icons?.map(icon => ( )) - : icons?.map((icon) => ( + : icons?.map(icon => ( {tags}} {!!sideDatas && ( - - {sideDatas.map((data) => ( + + {sideDatas.map(data => ( {data.data} @@ -151,11 +138,7 @@ export default function Hero({ ); } -export function defaultHeroSideDatas( - count: number, - maxApr: number, - dailyRewards: number -) { +export function defaultHeroSideDatas(count: number, maxApr: number, dailyRewards: number) { return [ !!count && { data: ( @@ -184,5 +167,5 @@ export function defaultHeroSideDatas( label: "Max APR", key: uuidv4(), }, - ].filter((data) => !!data); + ].filter(data => !!data); } diff --git a/src/components/element/participate/Participate.tsx b/src/components/element/participate/Participate.tsx index d4289c7..9a151f2 100644 --- a/src/components/element/participate/Participate.tsx +++ b/src/components/element/participate/Participate.tsx @@ -15,29 +15,17 @@ export type ParticipateProps = { displayLinks?: boolean; }; -export default function Participate({ - opportunity, - displayOpportunity, - displayMode, - displayLinks, -}: ParticipateProps) { +export default function Participate({ opportunity, displayOpportunity, displayMode, displayLinks }: ParticipateProps) { const [tokenAddress, setTokenAddress] = useState(); const [amount, setAmount] = useState(0n); - const [mode] = useState<"deposit" | "withdraw">( - typeof displayMode === "string" ? displayMode : "deposit" - ); + const [mode] = useState<"deposit" | "withdraw">(typeof displayMode === "string" ? displayMode : "deposit"); const { target, balance, token: inputToken, loading, - } = useParticipate( - opportunity.chainId, - opportunity.protocol?.id, - opportunity.identifier, - tokenAddress - ); + } = useParticipate(opportunity.chainId, opportunity.protocol?.id, opportunity.identifier, tokenAddress); const { link } = useOpportunity(opportunity); // const switchModeButton = useMemo(() => { @@ -70,8 +58,7 @@ export default function Participate({ to={opportunity.protocol?.url} disabled={!opportunity.protocol?.url} size="md" - look="base" - > + look="base"> Visit {opportunity.protocol.name} @@ -87,36 +74,25 @@ export default function Participate({ setAmount(a)]} + state={[amount, a => setAmount(a)]} base={inputToken?.decimals ?? 18} header={ {mode === "deposit" ? "Supply" : "Withdraw"} Balance - {inputToken && ( - - {Fmt.toPrice(inputToken.balance, inputToken)} - - )} + {inputToken && {Fmt.toPrice(inputToken.balance, inputToken)}} { setAmount(BigInt(inputToken?.balance ?? "0")); }} - size="xs" - > + size="xs"> Max } - suffix={ - - } + suffix={} placeholder="0.0" /> {/* biome-ignore lint/complexity/noUselessFragments: */}