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
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 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
- Card: title "Gifts sent for this challenge".
- List (
MiniList, named by the title): oneMiniRowper claim:- Title: the claim code ("GS-0015"), isolated.
- Sub: "25 claimed", or "25 claimed · 23 confirmed" once
confirmedis set. - Trailing:
PrStatusPillfor the claim'sstatus(gift_expected,gift_arrived,gift_confirmed, …).
- Note (muted, 8px under): "Approve now if you like: the challenge goes live only once these gifts are confirmed." (
notereplaces it). - Empty: instead of 2–3, the muted "No gifts sent for it yet.".
Variants
| Prop value | Look | When 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. |
onOpen | Each row is a button | Link to the claim in Gift stock. |
claims={[]} | "No gifts sent for it yet." | The brand sent no gifts for this request. |
note | Your note | Different copy. |
States
| State | How |
|---|---|
| Static rows | No onOpen. |
| Clickable rows | onOpen: the whole row is a button; the title turns raspberry on hover; focus ring. |
| Empty | claims 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
- PR Portal › Affiliate programs › Challenges › Brand requests › a request › the side column, under
RequestWalletCardand the gift stock card (PR · Brand request). Its rows lead to PR Portal › Gift stock › a gift claim (PR · A gift claim).
Guidelines
Do
- Pass only the claims sent for this request's challenge.
- Set
confirmedonce PR has counted a claim, so the row shows both numbers. - Give
onOpenso 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
BrandGiftStockCardorBrandGiftStock.
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.
Related
RequestWalletCard,RequestHandled,BrandRequestCard: the rest of the request page.GiftShipmentCard,GiftStatusPills: the claim itself and its statuses.BrandGiftStockCard: the brand's confirmed stock.MiniList/MiniRow: its rows.
See also: Card · useLanguage · PrEmpty · PrStatusPill · WalletHealthPill · SummaryLine · SummarySection · BuilderStepCard · ChallengeAudienceFields
Source
src/pr/challenges/BrandRequestCardParts.tsx (line 118) on GitHub.