Skip to content

ads: add a persistent "Monetize a new site" button on /ads/slots - #101

Merged
ralyodio merged 1 commit into
masterfrom
ads/monetize-new-site-button
Jul 17, 2026
Merged

ralyodio merged 1 commit into
masterfrom
ads/monetize-new-site-button

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Problem

On /ads/slots ("Monetize your site") there was no way to start monetizing another site once you already had projects. The only link to project creation lived inside the empty state (projects.length === 0), which never renders when you have projects — so with sites already added, the page showed the list with no "add a site" affordance. (Not a new regression — the link was always empty-state-only — but it reads as a missing button.)

Fix

  • Persistent header button — "Monetize a new site" in the Monetize header, always visible.
  • Closes the loop — /projects/new now accepts ?next=<relative-path> and returns there after creating (guarded to same-site relative paths — no open redirect). So the button sends you to /projects/new?next=/ads/slots, and after creating you land back on /ads/slots with the new site ready to Enable ads.
  • Empty-state "Create one" link is now return-aware too.

Changes

  • app/(app)/ads/slots/page.tsx — header button + return-aware empty-state link
  • app/(app)/projects/new/page.tsx — read next from searchParams (Next 16 async), pass to form
  • app/(app)/projects/new/form.tsx — redirect to next when it's a safe relative path

Verified

  • tsc --noEmit clean
  • next build compiles; /ads/slots and /projects/new build as expected

🤖 Generated with Claude Code

There was no way to start monetizing another site once you already had
projects: the only link to project creation lived inside the empty state,
which never shows when you have projects. Add an always-visible
"Monetize a new site" button in the Monetize header.

To close the loop, /projects/new now accepts ?next=<relative-path> and
returns there after creating (guarded to same-site relative paths), so
"Monetize a new site" lands you back on /ads/slots with the new site
ready to "Enable ads".

- app/(app)/ads/slots/page.tsx: header button + return-aware empty-state link
- app/(app)/projects/new/page.tsx: read `next` from searchParams
- app/(app)/projects/new/form.tsx: redirect to `next` when safe

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 8698ddd into master Jul 17, 2026
8 checks passed
@ralyodio
ralyodio deleted the ads/monetize-new-site-button branch July 17, 2026 07:50
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.

1 participant