Skip to Content
BBRICKSv0.7.4
PR PortalChallenges

RequestGiftsCard

A brand request page's "Gifts sent for this challenge" card (the v3 mock's P.request): each claim's code, the units claimed (and confirmed, once counted) and its status pill, then the note that the challenge goes live only once the gifts are confirmed; "No gifts sent for it yet." with none.

import { RequestGiftsCard } 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 RequestGiftsCard. Written in docs/content/components/RequestGiftsCard.md; the props above are read from the code, which wins where the two disagree.

The brand request page's "Gifts sent for this challenge" card: each gift claim's code, units claimed (and confirmed, once counted) and its status pill, then the rule that the challenge goes live only once the gifts are confirmed; use it in the side column of a brand's challenge request.

It is the PR v3 mock's P.request last side card (.mini rows with the claim id, "25 claimed · 23 confirmed" and gPill). Before 0.7 the screen built it from a Card, mini rows and a muted paragraph; use RequestGiftsCard instead. With no claims it shows "No gifts sent for it yet.". A row opens the claim (PR Portal › Gift stock › the claim) through onOpen.

Anatomy

  1. Card: title "Gifts sent for this challenge".
  2. List (MiniList, named by the title): one MiniRow per claim:
    • Title: the claim code ("GS-0015"), isolated.
    • Sub: "25 claimed", or "25 claimed · 23 confirmed" once confirmed is set.
    • Trailing: PrStatusPill for the claim's status (gift_expected, gift_arrived, gift_confirmed, …).
  3. Note (muted, 8px under): "Approve now if you like: the challenge goes live only once these gifts are confirmed." (note replaces it).
  4. Empty: instead of 2–3, the muted "No gifts sent for it yet.".

Variants

Prop valueLookWhen to use
claims with no confirmed"N claimed"The claim is not counted yet (Expected, Arrived).
claims with confirmed"N claimed · M confirmed"PR counted it.
onOpenEach row is a buttonLink to the claim in Gift stock.
claims={[]}"No gifts sent for it yet."The brand sent no gifts for this request.
noteYour noteDifferent copy.

States

StateHow
Static rowsNo onOpen.
Clickable rowsonOpen: the whole row is a button; the title turns raspberry on hover; focus ring.
Emptyclaims is empty.

Usage

// PR Portal › Affiliate programs › Challenges › Brand request: the gifts for this request; a row opens the claim
import { RequestGiftsCard, type RequestGiftClaim } from '@ergasti/bricks';

const claims: RequestGiftClaim[] = [
  { id: 'GS-0015', claimed: 25, status: 'gift_expected' },
  { id: 'GS-0011', claimed: 25, confirmed: 23, status: 'gift_confirmed_diff' },
];

export function RequestGifts({ openClaim }: { openClaim: (id: string) => void }) {
  return <RequestGiftsCard claims={claims} onOpen={(claim) => openClaim(claim.id)} />;
}
// Nothing sent yet
import { RequestGiftsCard } from '@ergasti/bricks';

export function NoGiftsYet() {
  return <RequestGiftsCard claims={[]} />;
}

Where it appears

Guidelines

Do

  • Pass only the claims sent for this request's challenge.
  • Set confirmed once PR has counted a claim, so the row shows both numbers.
  • Give onOpen so PR can go count a claim from here.

Don't

  • Don't block approving on unconfirmed gifts; the note tells PR the challenge waits for them.
  • Don't use it for the brand's whole stock; that is BrandGiftStockCard or BrandGiftStock.

RTL and Arabic

  • Rows mirror (pill at the left in Arabic); codes stay LTR inside <bdi>.
  • Its words: "الهدايا اللي اتبعتت للتحدي ده", "25 متبلّغ عنهم", "23 اتأكدوا", "وافق دلوقتي لو حابب: التحدي هيبدأ بس لما الهدايا دي تتأكد.", "لسه مفيش هدايا اتبعتت ليه.". Counts use Latin digits (count).

Tokens

--ink-3 (sub and note), --rasp (hover title); card, mini-row and pill tokens.

Accessibility

  • A <ul> named "Gifts sent for this challenge"; each claim is an <li>.
  • Clickable rows are a native <button type="button">.
  • Status pills state the status in words; codes are isolated with <bdi>.

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 · PrEmpty · PrStatusPill · WalletHealthPill · SummaryLine · SummarySection · BuilderStepCard · ChallengeAudienceFields

Source

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

On this page