Skip to Content
BBRICKSv0.7.4
PR PortalChallenges

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

Pinned to 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.

prRequestCards
KeyEnglishArabic
wallet{brand} walletمحفظة {brand}
availableAvailableالمتاح
requestedRequested budgetالميزانية المطلوبة
enoughEnough to hold the full budget.كفاية تحجز الميزانية كلها.
shortNot enough. Ask the brand to top up first.مش كفاية. اطلب من البراند يشحن الأول.
giftsGifts sent for this challengeالهدايا اللي اتبعتت للتحدي ده
claimed{n} claimed{n} متبلّغ عنهم
confirmed{n} confirmed{n} اتأكدوا
giftsNoteApprove now if you like: the challenge goes live only once these gifts are confirmed.وافق دلوقتي لو حابب: التحدي هيبدأ بس لما الهدايا دي تتأكد.
noGiftsNo gifts sent for it yet.لسه مفيش هدايا اتبعتت ليه.
handledRequest handledالطلب اتعامل معاه
handledTextThis request was already handled.الطلب ده اتعامل معاه قبل كده.
backBack 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

  1. Card: title "{brandName} wallet", WalletHealthPill badge (health, healthDay).
  2. Figures (SummarySection, a <dl>): Available (MoneyNote figure wallet_available) and Requested budget (wallet_held), amounts through Money (slot challengeSummary.figures).
  3. Verdict: muted "Enough to hold the full budget." or the red field-error "Not enough. Ask the brand to top up first." (role="status", shortNote replaces it), 8px under the figures.

Variants

Prop valueLookWhen to use
health="ok" / "low" / "negative" / "paused"Healthy / Low funds / "Below zero · day 4/7" (with healthDay) / Paused pillThe wallet's health from the server.
available ≥ requestedMuted "Enough…"Default verdict, in exact cents.
available < requestedRed "Not enough…"Default verdict.
enoughForces the verdictThe server already decided (holds, pending top-ups).
shortNoteYour red lineA "Remind the brand" button or other copy.
money={{ decimals: 'auto' }}"EGP 22,000" (no ".00")As the PR mock shows money.

States

StateHow
FundedMuted verdict.
ShortRed verdict, a polite status region.
Unreadable amountEither 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 shortNote to give PR a next step when the wallet is short.

Don't

  • Don't compute enough with 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 Card with an h2; figures are a <dl>; each money label is a MoneyNote explaining 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.

See also: Card · useLanguage · MiniList · MiniRow · PrEmpty · PrStatusPill · BuilderStepCard · ChallengeAudienceFields

Source

src/pr/challenges/BrandRequestCardParts.tsx (line 69) on GitHub.

On this page