Skip to Content
BBRICKSv0.7.4
PR PortalCampaigns

CampaignChallenges

The campaign page's "Challenges in this campaign" card (the v3 mock's .mini rows): per challenge its name, a "TRNDR-wide" tag when it runs for every brand, the line "type · goal · reward · dates" and its status pill; each row opens the challenge. "+ New challenge" in the header. Rows are buttons in a list.

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

Examples

Challenges in a campaign

TRNDR-wide ones are tagged; each row opens the challenge.

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

function Challenges() {
  return (
    <CampaignChallenges onOpen={() => {}} onNew={() => {}} challenges={[
      { id: 'x2nov', name: 'Double commission week', wide: true, type: 'boost', goal: 'Every delivered sale', reward: '×2 commission · paid by TRNDR', dates: '20–26 Nov', status: 'upcoming' },
      { id: 'winter', name: 'Winter top 10', type: 'leader', goal: 'Top 10 by delivered sales', reward: 'EGP 1,000 each', dates: '1–30 Nov', status: 'live' },
    ]} />
  );
}

Props

Prop

Type

Labels

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

prCampaignChallenges
KeyEnglishArabic
titleChallenges in this campaignالتحديات في الحملة دي
addNew challengeتحدي جديد
noneNo challenges yet.مفيش تحديات لسه.
wideTRNDR-wideلكل TRNDR
type.leaderLeaderboardلوحة ترتيب
type.targetTargetهدف
type.boostCommission boostزيادة العمولة

Design guidance

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

The campaign page's "Challenges in this campaign" card: each challenge's name, a TRNDR-wide tag, its type, goal, reward and dates, and its status, each row opening the challenge; use it on the PR campaign page.

CampaignChallenges is the v3 mock's .mini rows under a campaign. Challenges moved inside Affiliate programs in v3, so the campaign page lists the ones running in (or planned for) that brand's campaign, including TRNDR-wide ones that run for every brand. "+ New challenge" opens the builder with this brand chosen.

Anatomy

  1. Card: <section class="kit-card kit-pr-cchs"> labelled by its h2 "Challenges in this campaign".
  2. Header action (with onNew): small "+ New challenge" button.
  3. List: a <ul> of row buttons: bold name (dir="auto") + sky "TRNDR-wide" pill when wide; muted line "Commission boost · Every delivered sale · ×2 commission · paid by TRNDR · 20–26 Nov"; PrStatusPill at the end. Ruled between, raspberry title on hover.
  4. Empty: "No challenges yet."

Variants

Challenge typeWord
leaderLeaderboard (the top creators win)
targetTarget (everyone who hits the goal)
boostCommission boost (every delivered sale earns more)

status is any PR status key (live, upcoming, settling, ended).

States

StateTrigger
Emptychallenges=[]
Hover / focustitle raspberry / inset focus ring
No add buttonno onNew

Types

CampaignChallenge (challenges): { id, name, type: 'leader' | 'target' | 'boost', goal, reward, dates, status, wide? } (texts formatted by the app).

Usage

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

export function Challenges() {
  return (
    <CampaignChallenges onOpen={() => {}} onNew={() => {}} challenges={[
      { id: 'x2nov', name: 'Double commission week', wide: true, type: 'boost', goal: 'Every delivered sale', reward: '×2 commission · paid by TRNDR', dates: '20–26 Nov', status: 'upcoming' },
      { id: 'winter', name: 'Winter top 10', type: 'leader', goal: 'Top 10 by delivered sales', reward: 'EGP 1,000 each', dates: '1–30 Nov', status: 'live' },
    ]} />
  );
}
// Campaign page: requests, next campaign and challenges side by side
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(360px, 1fr))', gap: 16 }}>
  <CampaignChangeRequests brandName="Glow Lab" requests={requests} onApprove={approve} onDecline={askReason} />
  <NextCampaignCard next={next} currentName="Winter glow 2026" onDecline={declineNext} onSchedule={() => setScheduling(true)} />
  <CampaignChallenges challenges={challenges} onOpen={(c) => openChallenge(c.id)} onNew={() => newChallenge('glow')} />
</div>

Where it appears

  • PR Portal › Affiliate programs › Campaigns › a campaign's page › "Challenges in this campaign".
  • Dashboard screen: PrPrograms.

Guidelines

Do

  • Format goal, reward and dates in the app, short ("1–30 Nov").
  • Tag TRNDR-wide challenges so PR knows who pays.

Don't

  • Don't show ended challenges forever; keep the list to the current campaign.
  • Don't put actions inside rows; open the challenge instead.

RTL and Arabic

Rows mirror; names and lines use dir="auto". Arabic: "التحديات في الحملة دي", "تحدي جديد", "لكل TRNDR", types "لوحة ترتيب" / "هدف" / "زيادة العمولة".

Tokens

--line, --ink, --rasp, --focus-ring-inset, --sky, --sky-ink, card tokens.

Accessibility

A labelled section with a list of <button> rows; status in words; the add button has a visible label.

Found in the source

  • ARIA attributes set: aria-labelledby.
  • Its tests cover: “+ New challenge, and the keyboard reaches each row”.

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

See also: Button · Pill · useLanguage · PrIcon · PrStatusPill · AffiliateProgramCard · CampaignChangeRequests · CommissionChangeForm · CustomerAffiliatesCard

Source

src/pr/programs/CampaignChallenges.tsx (line 63) on GitHub.

On this page