Skip to Content
BBRICKSv0.7.4
BlocksMotivation

ChallengeDetail

The challenge drawer's body: a tinted head (title, dates, status), TRNDR's reason or the waiting note, the figures, gifts and days progress, the top creators (ranked, each opens) and the actions for its status.

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

Examples

Challenge drawer body

The figures, the top creators and the actions for a live challenge. The status word comes from the TRNDR preset.

Pinned to TRNDR preset
Code
import { ChallengeDetail } from '@ergasti/bricks';
import { blocksData } from './sample-data';
import { useLanguage } from '@ergasti/bricks';

function Live() {
  const language = useLanguage();
  const c = blocksData.CHALLENGES[0];
  return (
    <div style={{ maxWidth: 400 }}>
      <ChallengeDetail
        title={c.title} status="live" tone="rasp" dates={c.dates} commissionLabel={c.comm[language]} creators={42} sales="184300.00" commissionPaid="27645.00"
        gifts={c.gifts} days={c.days} topCreators={blocksData.CHALLENGE_TOP} onOpenCreator={() => {}} onAction={() => {}} onOpenAnalytics={() => {}}
      />
    </div>
  );
}

A rejected request

The reason from TRNDR leads and the action is "Edit and resend". The status word comes from the TRNDR preset.

Pinned to TRNDR preset
Code
import { ChallengeDetail } from '@ergasti/bricks';
import { blocksData } from './sample-data';
import { useLanguage } from '@ergasti/bricks';

function Rejected() {
  const language = useLanguage();
  const c = blocksData.CHALLENGES[3];
  return (
    <div style={{ maxWidth: 400 }}>
      <ChallengeDetail title={c.title} status="rejected" tone="lilac" dates="—" commissionLabel={c.comm[language]} reason={c.reason?.[language]} creators={0} sales="0.00" commissionPaid="0.00" onAction={() => {}} />
    </div>
  );
}

A request waiting for TRNDR

sentOn says when the request went in; with no days and no gifts those rows are left out. challengeLabels overrides the words shared with the challenge card.

Pinned to TRNDR preset
Code
import { ChallengeDetail } from '@ergasti/bricks';
import { blocksData } from './sample-data';
import { useLanguage } from '@ergasti/bricks';

function Pending() {
  const language = useLanguage();
  const c = blocksData.CHALLENGES[0];
  return (
    <div style={{ maxWidth: 400 }}>
      <ChallengeDetail title="Ramadan preview" status="waiting" tone="butter" dates="1 Mar – 30 Mar" commissionLabel={c.comm[language]} sentOn="12 Nov 2026" creators={0} sales="0.00" commissionPaid="0.00" onAction={() => {}} challengeLabels={{ waitingDrawer: (date) => `Sent to TRNDR on ${date}. They usually reply within 2 days.` }} />
    </div>
  );
}

A scheduled challenge's drawer

"Scheduled" in the head, no banner and no status action; "See in analytics" once creators joined.

Pinned to TRNDR preset
Code
import { ChallengeDetail } from '@ergasti/bricks';
import { blocksData } from './sample-data';

function Scheduled() {
  const c = blocksData.CHALLENGES[0];
  return (
    <div style={{ maxWidth: 400 }}>
      <ChallengeDetail title={c.title} status="scheduled" tone="lime" dates={c.dates} commissionLabel="15% of sale" creators={0} sales="0.00" commissionPaid="0.00" gifts={{ taken: 0, total: 100 }} days={{ current: 0, total: 30 }} />
    </div>
  );
}

Props

Prop

Type

Labels

Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the keys challengeDetail, challengeCard, or with the component's own prop where it has one. A {name} is a value the component fills in.

challengeDetail
KeyEnglishArabic
commissionCommissionالعمولة
joinedCreators joinedصنّاع المحتوى اللي اشتركوا
salesSalesالمبيعات
paidCommission paidالعمولة المدفوعة
progressProgressالتقدّم
topTop creators in this challengeأحسن صنّاع محتوى في التحدي
analyticsSee in analyticsشوفه في التحليلات
challengeCard
KeyEnglishArabic
reasonLeadReason from TRNDR:السبب من TRNDR:
waitingSent {d}. You'll be told when it's approved or changed.اتبعت {d}. هنبلّغك لما يتوافق عليه أو يتعدّل.
waitingDrawerSent {d}. The TRNDR team reviews it and sets the dates.اتبعت {d}. فريق TRNDR هيراجعه ويحدد المواعيد.
giftsGifts takenالهدايا اللي اتاخدت
daysDaysالأيام
creatorsCreatorsصنّاع المحتوى
salesSalesالمبيعات
commissionCommissionالعمولة
action.liveRequest a changeاطلب تعديل
action.waitingEdit requestعدّل الطلب
action.rejectedEdit and resendعدّل وابعت تاني

Design guidance

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

The challenge drawer's body: a tinted head (title, dates, status), TRNDR's reason or the waiting note, the figures, gifts and days progress, the top creators (ranked, each opens) and the actions for its status; open it from a ChallengeCard.

It is the mock's openChallenge() drawer on Brand › Motivation. Money comes as 2-dp strings and shows compact ("EGP 27.6K"). Progress rows appear only when there are gifts (total > 0) or dates (more than one day); top creators appear only once someone joined. Pass the drawer's title hidden (Drawer hideTitle) so it is not drawn twice.

Anatomy

  1. Head: DrawerHead in tone: title; sub "1 Nov → 30 Nov 2026 · StatusPill".
  2. Banner: rejected → warn "Reason from TRNDR: …"; waiting → info "Sent 12 Nov 2026. The TRNDR team reviews it and sets the dates."
  3. Figures: KeyValue: Commission, Creators joined, Sales (challenge_sales), Commission paid (challenge_commission).
  4. Progress: h3 + Gifts taken / Days ProgressRows.
  5. Top creators: h3 "Top creators in this challenge" with the creator_sales "?", RankList (medals, each opens the creator).
  6. Actions: rasp state action ("Request a change", "Edit request", "Edit and resend") and "See in analytics".

Variants

statusBannerAction
live—Request a change
waitingsent noteEdit request
rejectedreasonEdit and resend
ended / closed—none (pill "Ended")
scheduled / paused—only with challengeLabels.action

money.figures / money.topCreators set display (both compact by default).

States

StateTrigger
No gifts / no datesgifts omitted or total 0; days omitted or total ≤ 1: rows hidden.
Nobody joinedcreators: 0: no top creators, no analytics button.
Openable creatorsonOpenCreator.

Usage

<Drawer open={!!ch} onClose={close} title={ch.title} hideTitle>
  <ChallengeDetail title="Winter glow launch" status="live" tone="rasp" dates="1 Nov → 30 Nov 2026" commissionLabel="15% of sale"
    creators={42} sales="184300.00" commissionPaid="27645.00"
    gifts={{ taken: 68, total: 100 }} days={{ current: 13, total: 30 }}
    topCreators={[{ person: { id: 9, name: 'Tarek Fathy' }, sales: '61600.00' }, { person: { id: 2, name: 'Salma Hosny' }, sales: '39360.00' }]}
    onOpenCreator={openCreator} onAction={requestChange} onOpenAnalytics={() => navigate('/analytics?challenge=winter')} />
</Drawer>

Where it appears

  • Brand › Motivation › Challenges › challenge drawer (openChallenge()) (BrandMotivation).

Guidelines

Do

  • Use the same tone as the card.
  • Hide the drawer's own title (hideTitle); the head shows it.

Don't

  • Don't send zero-total gifts to force a row; omit gifts.

RTL and Arabic

  • Mirrors; money LTR. Arabic: "أحسن صنّاع محتوى في التحدي", "العمولة المدفوعة", "شوفه في التحليلات".

Tokens

DrawerHead tone pairs; Banner, KeyValue, ProgressRow, RankList tokens.

Accessibility

  • Sections have h3s; RankList is a named list; banners are status messages; money keeps its "?".

Found in the source

  • No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.

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

See also: Banner · KeyValue · RankList · Button · MoneyNote · Money · StatusPill · DrawerHead · ProgressRow · useLanguage · useMoneyDisplay · BonusCard

Source

src/blocks/motivation/ChallengeDetail.tsx (line 74) on GitHub.

On this page