Skip to Content
BBRICKSv0.7.4
PR PortalChallenges

BrandRequestCard

A brand's challenge request under review (v3 mock P.request's main card): "What the brand asked for" with its status, the dates, budget and reward side by side, the brand's message quoted, what approving means, and "Reject with reason" / "Approve and build". The wallet and gift stock beside it are the app's own cards (SummarySection lines).

import { BrandRequestCard } from '@ergasti/bricks';

Examples

Brand request

What a brand asked for (dates, budget, reward), its message, and Reject with reason / Approve and build.

Code
import { BrandRequestCard } from '@ergasti/bricks';

function Request() {
  return (
    <div style={{ maxWidth: 820 }}>
      <BrandRequestCard dates="1–31 Dec" budget="15000.00" reward="Cash" money={{ decimals: 'auto' }} onReject={() => {}} onApprove={() => {}}
        message="We want to push our winter line before New Year. Happy to go up to 15,000." />
    </div>
  );
}

A decision that failed

error shows a red alert above the buttons (true: "Couldn’t save your decision."), with Try again when you pass onRetry.

Code (not run)
import { BrandRequestCard } from '@ergasti/bricks';

function Failed() {
  return (
    <div style={{ maxWidth: 820 }}>
      <BrandRequestCard dates="1–31 Dec" budget="15000.00" reward="Cash" money={{ decimals: 'auto' }} onReject={() => {}} onApprove={() => {}} error onRetry={() => {}} />
    </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 prBrandRequest, or with the component's own prop where it has one. A {name} is a value the component fills in.

prBrandRequest
KeyEnglishArabic
titleWhat the brand asked forالبراند طلب إيه
datesDatesالتواريخ
budgetBudgetالميزانية
rewardRewardالجايزة
messageThe brand’s messageرسالة البراند
noteOnce you approve, the challenge is yours: you build it, pick the creators and manage it to the end.لما توافق، التحدي يبقى بتاعك: إنت اللي تبنيه وتختار صنّاع المحتوى وتتابعه للآخر.
rejectReject with reasonارفض مع السبب
approveApprove and buildوافق وابني
workingWorking…لحظة…
errorCouldn’t save your decision.مقدرناش نحفظ قرارك.
retryTry againجرّب تاني

Design guidance

How the BRICKS design system uses BrandRequestCard. Written in docs/content/components/BrandRequestCard.md; the props above are read from the code, which wins where the two disagree.

A brand's challenge request under PR review: "What the brand asked for" with its status, the dates, budget and reward side by side, the brand's message quoted, what approving means, and "Reject with reason" / "Approve and build"; use it as the main card of the request page.

It is the v3 PR mock's P.request main card. The wallet and gift stock beside it are the app's own cards (SummarySection without a title). Approving opens the challenge builder pre-filled from the request; rejecting opens the app's ReasonDialog.

Anatomy

  1. Card (<section class="kit-card kit-pr-req">, labelled by its title).
  2. Head: "What the brand asked for" (h2) and a PrStatusPill (default needs_review).
  3. Facts (<dl>, three columns; one on phones): Dates, Budget (a MoneyNote term) and Reward; 12px labels over 14px bold values.
  4. Message (<blockquote>, soft, radius 16): the brand's own words in quotes, isolated.
  5. Note (12.5px muted): "Once you approve, the challenge is yours: you build it, pick the creators and manage it to the end."
  6. Actions: "Reject with reason" (outline) and "Approve and build →" (ink; the arrow flips in RTL).

Variants

PropsLook
cash requestReward "Cash", budget "EGP 15,000".
gift requestDates "Dates set by TRNDR", reward "Gift" (story GiftRequest).
no messageNo quote.
no handlersNo actions (read-only).
statusAny PR status key.

States

StateHow
Default—
Workingbusy: both disabled, Approve reads "Working…" with aria-busy.

Types

PrBrandRequestCopy (labels): title, dates, budget, reward, message, note, reject, approve, working, and the optional error, retry.

Usage

import { useState } from 'react';
import { BrandRequestCard, Card, SummaryLine, SummarySection } from '@ergasti/bricks';

export function RequestPage({ approveAndBuild }: { approveAndBuild: () => Promise<void> }) {
  const [approving, setApproving] = useState(false);
  const [reasonOpen, setReasonOpen] = useState(false);
  return (
    <div className="scr-grid scr-grid--84">
      <BrandRequestCard
        dates="1–31 Dec"
        budget="15000.00"
        reward="Cash"
        message="We want to push our winter line before New Year. Happy to go up to 15,000."
        money={{ decimals: 'auto' }}
        busy={approving}
        onReject={() => setReasonOpen(true)}
        onApprove={async () => { setApproving(true); await approveAndBuild(); setApproving(false); }}
      />
      <Card title="Glow Lab wallet">
        <SummarySection>
          <SummaryLine label="Available" amount="43390.00" figure="wallet_available" />
          <SummaryLine label="Held for orders" amount="18450.00" figure="wallet_held" />
        </SummarySection>
      </Card>
    </div>
  );
}

Where it appears

Guidelines

Do

  • Quote the brand's message exactly.
  • Always ask for a reason on Reject.
  • Set busy while approving.

Don't

  • Don't edit the request here; approve opens the builder for changes.

RTL and Arabic

  • Facts and actions mirror; the arrow flips. "البراند طلب إيه", "ارفض مع السبب", "وافق وابني".

Tokens

--ink-3, --soft; card and button tokens.

Accessibility

  • A labelled <section>; facts are a <dl>; the quote is a <blockquote> named "The brand's message".
  • Status pill in words; the arrow icon is aria-hidden.

Found in the source

  • ARIA attributes set: aria-labelledby, aria-label, aria-busy, aria-hidden.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Button · Money · MoneyNote · useLanguage · PrIcon · PrStatusPill · BuilderStepCard · ChallengeAudienceFields · ChallengeBasicsFields · ChallengeGiftPicker

Source

src/pr/challenges/BrandRequestCard.tsx (line 74) on GitHub.

On this page