Skip to content

Give /privacy and /terms the marketing page header - #2593

Merged
kushagrasarathe merged 3 commits into
feat/marketing-localizationfrom
feat/legal-pages-header
Aug 5, 2026
Merged

Give /privacy and /terms the marketing page header#2593
kushagrasarathe merged 3 commits into
feat/marketing-localizationfrom
feat/legal-pages-header

Conversation

@innolope-dev

@innolope-dev innolope-dev commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #2592 — review that one first; this branch targets it, so the diff here is just the two page components plus two catalog strings.

Problem

/en/privacy and /en/terms render as bare prose with no header, unlike every other marketing page.

The pink hero and yellow marquee come from the MDX <Hero> component. Help articles get it because their content markdown contains a <Hero title="…" /> tag, and so do the five card-* legal pages (card-esign, card-privacy, card-terms-us, card-terms-international, card-prohibited-activities). Only privacy and terms never had one.

Why the fix is in the page component, not the content

Legal markdown is content_mode: verbatim and authored upstream in peanutprotocol/mono. content/legal/README.md is explicit that content generation must never overwrite those files, and peanut-ui/src/content is a read-only mirror — anything written there is reverted by the next mirror run.

Rendering <Hero> from privacy/page.tsx and terms/page.tsx sidesteps that entirely and applies to every locale without touching legal text.

Localization

  • Title comes from mdxSource.frontmatter.title, with the | Peanut suffix already stripped by the existing displayTitle. Legal is English-only today (translations are gated on legal review), so it renders English via the fallback chain — and picks up translations automatically if they ever ship, with no further code change.
  • Subtitle is a new catalog string, translated for all three locales:
    • privacy — "How we handle your data" / "Cómo tratamos tus datos" / "Como tratamos seus dados"
    • terms — "The agreement between you and Peanut" / "El acuerdo entre tú y Peanut" / "O acordo entre você e o Peanut"

Screenshot

image-1785440863769

Verification

tsc --noEmit clean, prettier --check . clean, production build green. Hero confirmed rendering on /en/privacy, /en/terms, /es-419/privacy and /pt-br/terms.

Note: stacked PRs in this repo don't always trigger the full CI matrix, since some workflows only fire for main/dev-based PRs. If checks look sparse here they should be kicked manually rather than read as green.

Both pages rendered as bare prose with no header, unlike every other marketing
page. The pink hero and yellow marquee come from the MDX <Hero> component,
which help articles and the five card-* legal pages get because their content
markdown includes a <Hero /> tag. privacy and terms never had one.

The header goes in the page components rather than the markdown: legal content
is content_mode: verbatim, authored upstream in peanutprotocol/mono, and
content/legal/README.md is explicit that generation must not overwrite those
files — anything written into the mirror would be reverted on the next sync.

Title comes from frontmatter (with the "| Peanut" suffix already stripped by
displayTitle), so it picks up legal translations automatically if they ever
ship and falls back to English until then. The subtitle is a catalog string,
translated for all three locales.
@innolope-dev innolope-dev self-assigned this Jul 30, 2026
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview Aug 4, 2026 2:19pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8f5fcde3-46a5-45d7-a139-d08682f7a3c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

…Hero

privacy/terms markdown is authored upstream with its own '# Title' — the
mirror is read-only, so rendering <Hero title> above it produced the same
string in two h1s. Strip only the FIRST node when it's an h1 (the bodies
use '##' for sections; a blanket strip would swallow authoring signals),
opt-in via renderContent's new stripLeadingH1 option, enabled on the two
pages that carry a Hero over verbatim content. The card-* legal pages
already follow the Hero-instead-of-h1 convention and are untouched.

Also merges the updated base (es-AR restore) and adds the two legal Hero
subtitle keys to the restored es-ar catalog (voseo).
@innolope-dev

Copy link
Copy Markdown
Collaborator Author

Pushed deb6d5db7 — fixes the duplicate <h1> this PR introduced on /privacy and /terms: the new <Hero title> sat above verbatim markdown that already opens with # Privacy Policy / # Terms of Service, so the same string rendered in two h1s. Since the content mirror is read-only (content_mode: verbatim), the fix is render-time: an opt-in positional stripLeadingH1 remark plugin in renderContent — it removes only the FIRST node when it's an h1 (the bodies use ## for sections; a blanket strip would swallow authoring signals), enabled on exactly these two pages. The card-* legal pages already follow the Hero-instead-of-h1 convention and are untouched.

Also merged the updated base (feat/marketing-localization — es-AR restore) and added the two legal Hero subtitle keys to the restored es-ar catalog.

Verified in the browser: exactly one h1 on /en/privacy, /en/terms and /es-419/privacy. Reminder for merge: this PR is stacked — after #2592 lands, retarget the base to dev in the UI (no force-push needed).

@kushagrasarathe
kushagrasarathe merged commit d742395 into feat/marketing-localization Aug 5, 2026
11 checks passed
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.

2 participants