Skip to Content
BBRICKSv0.7.4
PR PortalCampaigns

NextCampaignCard

The campaign page's "Next campaign" card (the v3 mock's NEXT, nextDo): the brand's request pill, its name, dates and suggested commission; Decline / Schedule it while it waits; the rule that two campaigns never run at once. Scheduled and declined keep the facts and their pill. With nothing requested it says how the brand asks for one.

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

Examples

Next campaign

The brand's request with Decline / Schedule it; scheduling asks for the customer rate of the new campaign.

Code
import { useState } from 'react';
import { NextCampaignCard, ScheduleCampaignDialog, type NextCampaign } from '@ergasti/bricks';

function Next() {
  const [next, setNext] = useState<NextCampaign>({ name: 'Ramadan 2027', from: '1 Feb 2027', to: '31 Mar 2027', commission: '18% of sale', status: 'waiting' });
  const [open, setOpen] = useState(false);
  return (
    <div style={{ maxWidth: 520 }}>
      <NextCampaignCard next={next} currentName="Winter glow 2026" onDecline={() => setNext({ ...next, status: 'declined' })} onSchedule={() => setOpen(true)} />
      <ScheduleCampaignDialog open={open} onClose={() => setOpen(false)} onConfirm={() => { setNext({ ...next, status: 'scheduled' }); setOpen(false); }} next={next}
        brandName="Glow Lab" customerRate="6" customerRateLabel="6% of sale" creatorRate="10" creatorRateLabel="10% of sale" />
    </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 prNextCampaign, or with the component's own prop where it has one. A {name} is a value the component fills in.

prNextCampaign
KeyEnglishArabic
titleNext campaignالحملة الجاية
nameNameالاسم
datesDatesالتواريخ
commissionSuggested commissionالعمولة المقترحة
range{from} → {to}{from} ← {to}
declineDeclineارفض
scheduleSchedule itجدولها
noteIt starts the day after {current} ends. Two campaigns never run at once.بتبدأ تاني يوم بعد ما {current} تخلص. مفيش حملتين بيشتغلوا مع بعض.
noneNothing requested. The brand can request one from its Campaign page.مفيش حاجة متطلبة. البراند يقدر يطلب حملة من صفحة الحملة بتاعته.
dialogTitleSchedule {name}?تجدول {name}؟
dialogSub[object Object][object Object]
rateLeadCustomer rate:عمولة العملاء:
rateNow[object Object][object Object]
rateLabelCustomer rate for {name}عمولة العملاء في {name}
rateHint[object Object][object Object]
errInvalidEnter a rate above 0.اكتب عمولة أكبر من صفر.
errNotBelow[object Object][object Object]
cancelCancelإلغاء
confirmScheduleجدولها

Design guidance

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

The campaign page's "Next campaign" card: the brand's requested next campaign (name, dates, suggested commission) with Decline / Schedule it, and the rule that two campaigns never run at once; use it on the PR campaign page with ScheduleCampaignDialog.

NextCampaignCard is the v3 mock's NEXT and nextDo. A brand asks for the campaign to run after its current one; PR declines (with a reason the brand sees) or schedules it. Scheduling opens ScheduleCampaignDialog, documented here too, which asks for the customer rate of the new campaign (above 0, below the creator rate; the same rule as CustomerAffiliatesCard). With nothing requested the card says how the brand asks.

Anatomy

NextCampaignCard

  1. Card head: "Next campaign" and the pill: Brand request (request_waiting, butter), Scheduled (green), Declined (red).
  2. Facts: Name, Dates ("1 Feb 2027 → 31 Mar 2027"), Suggested commission.
  3. Actions (waiting): Decline, ink "Schedule it".
  4. Note: "It starts the day after Winter glow 2026 ends. Two campaigns never run at once."
  5. Empty: "Nothing requested. The brand can request one from its Campaign page."

ScheduleCampaignDialog: kit Modal "Schedule Ramadan 2027?" with hint "dates · suggested commission"; an info banner "Customer rate: Glow Lab's customers earn 6% of sale now…"; the rate field (starts at the current rate) with hint and errors; Cancel / ink Schedule.

Variants

next.statusPillActions
waitingBrand requestDecline, Schedule it
scheduledSchedulednone
declinedDeclinednone
next nullnone"Nothing requested"

States

StateTrigger
Busybusy: buttons disabled
Dialog invalidSchedule with ≤ 0 or ≥ creator rate: "Enter a rate above 0." / "It must be below the creator rate (10% of sale)."
Dialog errorerror: alert above the buttons

Types

ScheduleCampaignDialog: open, onClose, onConfirm(rate) (ASCII digits), next, brandName, customerRate ("6"), customerRateLabel ("6% of sale"), creatorRate ("10"), creatorRateLabel ("10% of sale") (all required), busy?, error?, language?, labels?, inertRef?.

NextCampaign (next): { name, from, to, commission, status: 'waiting' | 'scheduled' | 'declined' }.

Usage

import { useState } from 'react';
import { NextCampaignCard, ScheduleCampaignDialog, type NextCampaign } from '@ergasti/bricks';

export function Next() {
  const [next, setNext] = useState<NextCampaign>({ name: 'Ramadan 2027', from: '1 Feb 2027', to: '31 Mar 2027', commission: '18% of sale', status: 'waiting' });
  const [open, setOpen] = useState(false);
  return (
    <div style={{ maxWidth: 520 }}>
      <NextCampaignCard next={next} currentName="Winter glow 2026" onDecline={() => setNext({ ...next, status: 'declined' })} onSchedule={() => setOpen(true)} />
      <ScheduleCampaignDialog open={open} onClose={() => setOpen(false)} onConfirm={() => { setNext({ ...next, status: 'scheduled' }); setOpen(false); }} next={next}
        brandName="Glow Lab" customerRate="6" customerRateLabel="6% of sale" creatorRate="10" creatorRateLabel="10% of sale" />
    </div>
  );
}
// Nothing requested yet
<NextCampaignCard next={null} currentName="Winter glow 2026" onDecline={() => {}} onSchedule={() => {}} />

Where it appears

  • PR Portal › Affiliate programs › Campaigns › a campaign's page › "Next campaign" (and the Schedule modal).
  • Dashboard screen: PrPrograms ("Campaigns and next-campaign card").

Guidelines

Do

  • Decline through ReasonDialog so the brand learns why.
  • Start the dialog's rate at the current customer rate so keeping it is one click.

Don't

  • Don't allow overlapping campaigns; the card states the rule.

RTL and Arabic

Mirrors; dates and commission in <bdi>; the rate input is dir="ltr" and accepts Arabic-Indic digits.

Tokens

--ink-3, --bad (facts list), card, pill, Banner and Modal tokens.

Accessibility

Labelled section; facts as a description list; the dialog is a kit Modal with a labelled field, hint and error; errors are alerts.

Found in the source

  • Roles in the markup: alert.
  • ARIA attributes set: aria-labelledby.

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

See also: Banner · Button · FormField · Modal · useLanguage · PrStatusPill · ScheduleCampaignDialog · AffiliateProgramCard · CampaignChallenges · CommissionChangeForm

Source

src/pr/programs/NextCampaignCard.tsx (line 83) on GitHub.

On this page