RequestWalletCard
A brand request page's wallet card (the v3 mock's P.request side card): "{brand} wallet" with its health pill, what is available and the requested budget, then "Enough to hold the full budget." or, in red, "Not enough. Ask the brand to top up first." (no line while either amount can't be read).
import { RequestWalletCard } from '@ergasti/bricks';Examples
A brand request's side cards
The brand's wallet against the requested budget ("Enough…", or a red "Not enough…" worked out in exact cents), and the gifts sent for the challenge with their status.
Code
import { RequestGiftsCard, RequestWalletCard } from '@ergasti/bricks';
function SideCards() {
return (
<div style={{ display: 'grid', gap: 16, maxWidth: 380 }}>
<RequestWalletCard brandName="Nile Threads" health="ok" available="22000.00" requested="15000.00" money={{ decimals: 'auto' }} />
<RequestWalletCard brandName="Mira Beauty" health="low" available="5200.00" requested="8000.00" money={{ decimals: 'auto' }} />
<RequestGiftsCard claims={[{ id: 'GS-0015', claimed: 25, status: 'gift_expected' }]} onOpen={() => {}} />
</div>
);
}Request handled
A link to a request someone already approved or rejected: RequestHandled with the way back.
Code (not run)
import { RequestHandled } from '@ergasti/bricks';
function Handled() {
return <RequestHandled onBack={() => {}} />;
}In Arabic
Code (not run)
import { RequestGiftsCard, RequestWalletCard } from '@ergasti/bricks';
function Arabic() {
return (
<div style={{ display: 'grid', gap: 16, maxWidth: 380 }}>
<RequestWalletCard brandName="Nile Threads" health="ok" available="22000.00" requested="15000.00" money={{ decimals: 'auto' }} />
<RequestGiftsCard claims={[]} />
</div>
);
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prRequestCards, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
wallet | {brand} wallet | محفظة {brand} |
available | Available | المتاح |
requested | Requested budget | الميزانية المطلوبة |
enough | Enough to hold the full budget. | كفاية تحجز الميزانية كلها. |
short | Not enough. Ask the brand to top up first. | مش كفاية. اطلب من البراند يشحن الأول. |
gifts | Gifts sent for this challenge | الهدايا اللي اتبعتت للتحدي ده |
claimed | {n} claimed | {n} متبلّغ عنهم |
confirmed | {n} confirmed | {n} اتأكدوا |
giftsNote | Approve now if you like: the challenge goes live only once these gifts are confirmed. | وافق دلوقتي لو حابب: التحدي هيبدأ بس لما الهدايا دي تتأكد. |
noGifts | No gifts sent for it yet. | لسه مفيش هدايا اتبعتت ليه. |
handled | Request handled | الطلب اتعامل معاه |
handledText | This request was already handled. | الطلب ده اتعامل معاه قبل كده. |
back | Back to challenges | ارجع للتحديات |
Design guidance
How the BRICKS design system uses RequestWalletCard. Written in docs/content/components/RequestWalletCard.md; the props above are read from the code, which wins where the two disagree.
The brand request page's wallet card: "{brand} wallet" with its health pill, Available and Requested budget, then whether the wallet can hold the budget; use it in the side column of a brand's challenge request so PR sees if approving is funded.
It is the PR v3 mock's P.request first side card (.kv rows and <p class="muted"> / <p class="err">). Before 0.7 the screen drew it from a Card, a WalletHealthPill, a SummarySection and its own verdict line; use RequestWalletCard instead: it compares the two server amounts in exact cents and draws "Enough to hold the full budget." or, in red, "Not enough. Ask the brand to top up first.".
Anatomy
- Card: title "{brandName} wallet",
WalletHealthPillbadge (health,healthDay). - Figures (
SummarySection, a<dl>): Available (MoneyNotefigurewallet_available) and Requested budget (wallet_held), amounts throughMoney(slotchallengeSummary.figures). - Verdict: muted "Enough to hold the full budget." or the red field-error "Not enough. Ask the brand to top up first." (
role="status",shortNotereplaces it), 8px under the figures.
Variants
| Prop value | Look | When to use |
|---|---|---|
health="ok" / "low" / "negative" / "paused" | Healthy / Low funds / "Below zero · day 4/7" (with healthDay) / Paused pill | The wallet's health from the server. |
| available ≥ requested | Muted "Enough…" | Default verdict, in exact cents. |
| available < requested | Red "Not enough…" | Default verdict. |
enough | Forces the verdict | The server already decided (holds, pending top-ups). |
shortNote | Your red line | A "Remind the brand" button or other copy. |
money={{ decimals: 'auto' }} | "EGP 22,000" (no ".00") | As the PR mock shows money. |
States
| State | How |
|---|---|
| Funded | Muted verdict. |
| Short | Red verdict, a polite status region. |
| Unreadable amount | Either amount not a money string and no enough: no verdict line at all. |
Usage
// PR Portal › Affiliate programs › Challenges › Brand request: the side column
import { PageGrid, RequestGiftsCard, RequestWalletCard } from '@ergasti/bricks';
export function RequestSide() {
return (
<PageGrid align="start">
<RequestWalletCard brandName="Nile Threads" health="ok" available="22000.00" requested="15000.00" money={{ decimals: 'auto' }} />
<RequestGiftsCard claims={[{ id: 'GS-0015', claimed: 25, status: 'gift_expected' }]} onOpen={() => {}} />
</PageGrid>
);
}// Not enough, with a way to act instead of the default line
import { Button, RequestWalletCard } from '@ergasti/bricks';
export function ShortWallet({ remind }: { remind: () => void }) {
return (
<RequestWalletCard
brandName="Mira Beauty" health="low" available="5200.00" requested="8000.00" money={{ decimals: 'auto' }}
shortNote={<>Not enough. <Button size="sm" onClick={remind}>Ask Mira Beauty to top up</Button></>}
/>
);
}// A wallet below zero, day 4 of the grace period
import { RequestWalletCard } from '@ergasti/bricks';
export function NegativeWallet() {
return <RequestWalletCard brandName="Kemet Home" health="negative" healthDay={4} available="-1200.00" requested="6000.00" />;
}Where it appears
- PR Portal › Affiliate programs › Challenges › Brand requests › a request › the side column, first card, above the gift stock card and
RequestGiftsCard(PR · Brand request).
Guidelines
Do
- Pass the server's 2-dp strings unchanged; the card compares them in cents.
- Show it before PR approves, beside
BrandRequestCard. - Use
shortNoteto give PR a next step when the wallet is short.
Don't
- Don't compute
enoughwith floats in the app; leave it out or pass the server's answer. - Don't hide the card when the wallet is short; the red line is the point.
- Don't use it for the brand detail page's full wallet; that is
BrandWalletCard.
RTL and Arabic
- Mirrors with the card; amounts stay LTR through
Money. - Its words: "محفظة Nile Threads", "المتاح", "الميزانية المطلوبة", "كفاية تحجز الميزانية كلها.", "مش كفاية. اطلب من البراند يشحن الأول.".
Tokens
--ink-3 (muted verdict), --bad (red verdict, .kit-field-err); card, pill and money tokens.
Accessibility
- A
Cardwith an h2; figures are a<dl>; each money label is aMoneyNoteexplaining the figure. - The health pill states the health in words (and the day).
- The red verdict is
role="status", so a change to "Not enough" is announced politely.
Found in the source
- Roles in the markup:
status.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
BrandRequestCard: the main card beside it.RequestGiftsCard,RequestHandled: the other request-page parts.WalletHealthPill,SummarySection,SummaryLine: its parts.BrandWalletCard: the brand detail page's wallet.
See also: Card · useLanguage · MiniList · MiniRow · PrEmpty · PrStatusPill · BuilderStepCard · ChallengeAudienceFields
Source
src/pr/challenges/BrandRequestCardParts.tsx (line 69) on GitHub.