Skip to content

feat: multi-step campaign creation form#92

Closed
josephchimebuka wants to merge 1 commit into
Dfunder:mainfrom
josephchimebuka:feat/issue-86-multistep-form
Closed

feat: multi-step campaign creation form#92
josephchimebuka wants to merge 1 commit into
Dfunder:mainfrom
josephchimebuka:feat/issue-86-multistep-form

Conversation

@josephchimebuka

Copy link
Copy Markdown
Contributor

Summary

Implements the Multi-Step Form Structure for campaign creation.

Closes #86

What's included

  • Adds src/pages/campaigns/CreateCampaignPage.jsx as the multi-step form container.
  • Manages the current step via formStep in the campaigns Redux slice (nextStep / prevStep / setFormStep).
  • Renders the correct step component based on formStep: Details → Funding → Media → Review.
  • Adds Next and Back buttons for navigation, plus a step progress indicator.
  • Persists form data in draftCampaign Redux state as the user moves between steps, so data is retained when going back.
  • Prompts an "unsaved changes" warning when leaving the page using useBeforeUnload.
  • Routes /create (and /campaigns/create) to the new page, replacing the previous static placeholder.

Changes

  • src/features/campaigns/campaignsSlice.js — add formStep + draftCampaign state with step/draft reducers and selectors (existing items/loading/error left intact)
  • src/pages/campaigns/CreateCampaignPage.jsx — step container with navigation + useBeforeUnload
  • src/pages/campaigns/steps/* — Details, Funding, Media, and Review step components
  • src/routes/AppRouter.jsx — point the create route to the new page
  • src/pages/CreateCampaign.jsx — removed (replaced by the multi-step page)

Acceptance criteria

  • Users can navigate between steps with Next/Back
  • Data persists when going back to a previous step (draftCampaign in Redux)
  • Unsaved changes trigger a leave-page warning (useBeforeUnload)
  • npm run build passes

Test plan

  • Go to /create, fill in step 1, click Next, then Back — data is retained
  • Refresh/close the tab with unsaved data — browser shows the warning
  • Complete all steps to the Review screen and submit

Made with Cursor

Build the multi-step form container that manages step navigation.

- Add src/pages/campaigns/CreateCampaignPage.jsx as the step container
- Manage the current step via formStep in the campaigns Redux slice
- Render the correct step component based on formStep (Details -> Funding -> Media -> Review)
- Add Next and Back buttons plus a progress indicator for navigation
- Persist form inputs in draftCampaign Redux state so data is retained when going back
- Warn on unsaved changes via useBeforeUnload when leaving the page
- Route /create (and /campaigns/create) to the new page, replacing the placeholder

Co-authored-by: Cursor <cursoragent@cursor.com>
@ayshadogo ayshadogo closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-Step Form Structure

2 participants