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.
| Key | English | Arabic |
|---|---|---|
title | Challenges in this campaign | التحديات في الحملة دي |
add | New challenge | تحدي جديد |
none | No challenges yet. | مفيش تحديات لسه. |
wide | TRNDR-wide | لكل TRNDR |
type.leader | Leaderboard | لوحة ترتيب |
type.target | Target | هدف |
type.boost | Commission 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
- Card:
<section class="kit-card kit-pr-cchs">labelled by itsh2"Challenges in this campaign". - Header action (with
onNew): small "+ New challenge" button. - List: a
<ul>of row buttons: bold name (dir="auto") + sky "TRNDR-wide" pill whenwide; muted line "Commission boost · Every delivered sale · ×2 commission · paid by TRNDR · 20–26 Nov";PrStatusPillat the end. Ruled between, raspberry title on hover. - Empty: "No challenges yet."
Variants
Challenge type | Word |
|---|---|
leader | Leaderboard (the top creators win) |
target | Target (everyone who hits the goal) |
boost | Commission boost (every delivered sale earns more) |
status is any PR status key (live, upcoming, settling, ended).
States
| State | Trigger |
|---|---|
| Empty | challenges=[] |
| Hover / focus | title raspberry / inset focus ring |
| No add button | no 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.
Related
PrChallengeCard: the challenge as a card on the Challenges tab.challengeColumns: the challenges table.MiniList: the same row look elsewhere.
See also: Button · Pill · useLanguage · PrIcon · PrStatusPill · AffiliateProgramCard · CampaignChangeRequests · CommissionChangeForm · CustomerAffiliatesCard
Source
src/pr/programs/CampaignChallenges.tsx (line 63) on GitHub.