Skip to content

Commit a2cecea

Browse files
Ruben Russelclaude
authored andcommitted
feat: clarify BREAD/xDAI on the deposit & withdraw flows
Now that the UI shows USD, add a short explainer (with a docs link) to the fund and withdraw modals so users understand what BREAD/xDAI are and where they live: - New reusable BreadInfoNote (links docs.bread.coop/bread-token). - Fund modal: note that funding uses xDAI on Gnosis, auto-converted to BREAD (worth $1 each, 1:1 with USD); balance shown in USD. - Withdraw modal: note that you're withdrawing BREAD (1:1 with USD) on Gnosis; amounts show in USD but you receive BREAD. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f83bc8a commit a2cecea

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎src/components/bread-info-note.tsx‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Body } from "@breadcoop/ui";
2+
import { InfoIcon } from "@phosphor-icons/react";
3+
import { ReactNode } from "react";
4+
import { LINKS } from "@/constants/links";
5+
6+
/**
7+
* Informational note explaining that amounts are BREAD (a USD-pegged token on
8+
* Gnosis), shown on the deposit/withdraw flows to reduce confusion now that the
9+
* UI displays USD. Links the BREAD token docs for the technical details.
10+
*/
11+
const BreadInfoNote = ({ children }: { children: ReactNode }) => (
12+
<div className="flex items-start gap-2 bg-paper-1 p-3">
13+
<InfoIcon
14+
size={20}
15+
weight="fill"
16+
className="mt-0.5 shrink-0 text-primary-blue"
17+
/>
18+
<Body className="text-xs text-surface-grey-2">
19+
{children}{" "}
20+
<a
21+
href={LINKS.docsBreadToken}
22+
target="_blank"
23+
rel="noopener noreferrer"
24+
className="font-bold text-primary-blue underline"
25+
>
26+
Learn more about BREAD &amp; xDAI
27+
</a>
28+
</Body>
29+
</div>
30+
);
31+
32+
export default BreadInfoNote;

‎src/components/modal/modals/fund-wallet/fund-wallet.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useEffect, useState } from "react";
77
import { useWatchFundedXdai } from "@/hooks/use-watch-funded-xdai";
88
import { Body, useConnectedUser } from "@breadcoop/ui";
99
import Alert from "@/components/alert";
10+
import BreadInfoNote from "@/components/bread-info-note";
1011
import { PeerIntentFulfilledResult } from "@zkp2p/sdk";
1112

1213
const FundWallet = ({ modalState }: { modalState: FundWalletModalState }) => {
@@ -41,6 +42,11 @@ const FundWallet = ({ modalState }: { modalState: FundWalletModalState }) => {
4142
<Body className="-mt-4">
4243
Send xDAI to your wallet and automatically get BREAD
4344
</Body>
45+
<BreadInfoNote>
46+
You fund with <strong>xDAI</strong> on the Gnosis network, which is
47+
automatically converted to <strong>BREAD</strong> — worth $1 each (1:1
48+
with USD). Your balance is shown in USD.
49+
</BreadInfoNote>
4450
<div className={result ? "" : ""}>
4551
{result && (
4652
<div>

‎src/components/modal/modals/withdraw-bread.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { useAccount, useReadContract } from "wagmi";
1717
import { Address, erc20Abi, isAddress } from "viem";
1818
import LocalButton from "@/components/button";
1919
import Loading from "@/app/loading";
20+
import BreadInfoNote from "@/components/bread-info-note";
2021
import { cn } from "@/lib/utils";
2122
import { BREAD_TOKEN_ADDRESS } from "@/lib/constants";
2223
import { getDefaultChainId } from "@/utils/chain";
@@ -192,6 +193,11 @@ const WithdrawBreadModal = () => {
192193
</>
193194
) : (
194195
<form className="*:mb-6" onSubmit={withdraw}>
196+
<BreadInfoNote>
197+
You&apos;re withdrawing <strong>BREAD</strong> — worth $1 each (1:1
198+
with USD) — from the Gnosis network. Amounts are shown in USD, but
199+
you receive BREAD in your wallet.
200+
</BreadInfoNote>
195201
<div>
196202
<Label htmlFor="address">Recipient Address</Label>
197203
<div className="relative">

0 commit comments

Comments
 (0)