From f032e87286860cc869d6e35b81c8c53f30392c7f Mon Sep 17 00:00:00 2001 From: kushagrasarathe <76868364+kushagrasarathe@users.noreply.github.com> Date: Mon, 16 Nov 2026 07:12:41 +0000 Subject: [PATCH 1/7] Retire the waitlist: /shhhhh redirects to /peanut-card (TASK-24171) /shhhhh, /shhhhh/ and its aliases (/sh, /lp/card) now 308 straight to /peanut-card, so there is one card landing page and no redirect chain. The /peanut-card CTA takes over badge-campaign handling (queue before the store hand-off, claim when signed in), so old campaign links keep their attribution. Native drops /shhhhh from the export; a legacy link opens the web, which redirects. Remove the physical-card list (no physical card exists, so joining it was a false promise), the unsupported-QR 'Get notified' flow (nothing was ever sent), queue-themed loading words and dead door/notify strings. The country drawer stays (demand-signal work keeps it) but stops promising a notification. --- e2e/flows/button-press-physics.spec.ts | 49 +-- e2e/flows/card-public.spec.ts | 11 +- e2e/shots/sweep-targets.ts | 2 - eslint.config.js | 6 +- public/llms-full.txt | 6 +- public/llms.txt | 6 +- redirects.json | 21 +- scripts/ds-lint-counts.mjs | 1 - scripts/screen-wordiness-core.cjs | 1 - scripts/screens/inventory.mjs | 2 +- src/app/(mobile-ui)/card/physical/page.tsx | 12 - .../dev/ds/primitives/title-block/page.tsx | 24 -- src/app/shhhhh/ShhhhhLandingPage.test.tsx | 194 ------------ src/app/shhhhh/ShhhhhLandingPage.tsx | 290 ------------------ src/app/shhhhh/__tests__/page.test.tsx | 28 -- src/app/shhhhh/page.tsx | 21 -- src/app/shhhhh/shhhhh-acquisition.test.ts | 28 -- src/app/shhhhh/shhhhh-acquisition.ts | 20 -- src/components/Card/PhysicalCardScreen.tsx | 119 ------- src/components/Card/YourCardScreen.tsx | 6 - .../__tests__/PhysicalCardScreen.test.tsx | 91 ------ .../__tests__/YourCardScreen.wallet.test.tsx | 6 +- .../Common/__tests__/CountryWaitlist.test.tsx | 22 +- src/components/Global/Loading/words.ts | 2 - .../__tests__/base58-case.test.tsx | 5 +- .../Global/QRScannerOverlay/index.tsx | 21 +- .../__tests__/usePeanutCardCta.test.tsx | 98 +++++- .../Marketing/StarLp/pages/PeanutCardCta.tsx | 6 +- .../StarLp/pages/usePeanutCardCta.ts | 53 +++- src/constants/analytics.consts.ts | 3 - .../signup-attribution-paths.generated.json | 1 - src/dev/screens/pages.ts | 1 - .../card-campaign-acquisition.test.ts | 27 ++ .../card/card-campaign-acquisition.ts | 21 ++ .../__tests__/useNativeAppLinks.test.tsx | 9 +- .../useZeroDev-ceremony-conflict.test.tsx | 2 +- .../useZeroDev-invite-onboarding.test.tsx | 12 +- .../useZeroDev-login-failure.test.tsx | 2 +- ...eZeroDev.username-hold.acceptance.test.tsx | 2 +- src/hooks/useZeroDev.ts | 4 +- src/i18n/app/messages/en.json | 48 +-- src/i18n/app/messages/en.marketing.json | 2 +- src/i18n/app/messages/es-419.json | 48 +-- src/i18n/app/messages/es-419.marketing.json | 2 +- src/i18n/app/messages/es-AR.json | 32 +- src/i18n/app/messages/es-AR.marketing.json | 3 - src/i18n/app/messages/pt-BR.json | 48 +-- src/i18n/app/messages/pt-BR.marketing.json | 2 +- src/lib/content.test.ts | 13 +- src/lib/content.ts | 7 +- src/lib/seo/__tests__/card-redirects.test.ts | 51 +++ src/lib/seo/url-inventory.ts | 2 - src/services/rain.ts | 23 +- src/utils/__tests__/native-routes.test.ts | 9 +- src/utils/native-routes.ts | 5 +- src/utils/performance-analytics.ts | 2 +- 56 files changed, 402 insertions(+), 1130 deletions(-) delete mode 100644 src/app/(mobile-ui)/card/physical/page.tsx delete mode 100644 src/app/shhhhh/ShhhhhLandingPage.test.tsx delete mode 100644 src/app/shhhhh/ShhhhhLandingPage.tsx delete mode 100644 src/app/shhhhh/__tests__/page.test.tsx delete mode 100644 src/app/shhhhh/page.tsx delete mode 100644 src/app/shhhhh/shhhhh-acquisition.test.ts delete mode 100644 src/app/shhhhh/shhhhh-acquisition.ts delete mode 100644 src/components/Card/PhysicalCardScreen.tsx delete mode 100644 src/components/Card/__tests__/PhysicalCardScreen.test.tsx create mode 100644 src/features/card/__tests__/card-campaign-acquisition.test.ts create mode 100644 src/features/card/card-campaign-acquisition.ts create mode 100644 src/lib/seo/__tests__/card-redirects.test.ts diff --git a/e2e/flows/button-press-physics.spec.ts b/e2e/flows/button-press-physics.spec.ts index d29e0463bc..ca553fddaf 100644 --- a/e2e/flows/button-press-physics.spec.ts +++ b/e2e/flows/button-press-physics.spec.ts @@ -8,10 +8,12 @@ * unit test cannot see this: the bug lives in which state wins in the * cascade, so it has to be read off computed style in a real browser. * - * /shhhhh is the target because it renders a real primary and a real secondary - * Button with no caller overrides, and needs no backend. The /dev/ds button - * page would be the obvious home, but every /dev route sits behind a session - * gate that never resolves in this harness, so it stays on "Loading...". + * The setup landing is the target because it renders a real primary (Sign up) + * and a real secondary (Log in) Button with no caller overrides, and needs no + * backend. A help page carries the NavHeader back circle (HeroBackNav). /shhhhh + * served both until it became a redirect (TASK-24171). The /dev/ds button page + * would be the obvious home, but every /dev route sits behind a session gate + * that never resolves in this harness, so it stays on "Loading...". * * Run: NEXT_PUBLIC_VERCEL_ENV=preview npm run build && npm run test:e2e:regression */ @@ -73,12 +75,22 @@ async function expectNoHoverFill(el: Locator) { expect(await background(el), 'no hover fill, so a press fill can only be :active').toBe('rgba(0, 0, 0, 0)') } -test.describe('Button press physics', () => { - test.beforeEach(async ({ page }) => { - await page.goto('/shhhhh', { waitUntil: 'domcontentloaded' }) +// Web signup is app-only; the support keep-web cookie reopens it in this browser. +// Same-origin only: an ipapi.co country would make the setup screens depend on +// the runner's IP and ipapi's rate limit. +async function openSetupLanding(page: Page, baseURL: string) { + await page.context().addCookies([{ name: KEEP_WEB_COOKIE, value: KEEP_WEB_COOKIE_VALUE, url: baseURL }]) + await page.route('**/*', (route) => { + const { hostname } = new URL(route.request().url()) + return hostname === '127.0.0.1' || hostname === 'localhost' ? route.continue() : route.abort() }) + await page.goto('/setup', { waitUntil: 'domcontentloaded' }) + await expect(page.getByRole('button', { name: 'Sign up' })).toBeVisible({ timeout: 60_000 }) +} - test('primary keeps its shadow on hover and drops into it on press', async ({ page }) => { +test.describe('Button press physics', () => { + test('primary keeps its shadow on hover and drops into it on press', async ({ page, baseURL }) => { + await openSetupLanding(page, baseURL!) const primary = pressable(page, 'btn-primary') await expect(primary).toBeVisible() @@ -102,6 +114,7 @@ test.describe('Button press physics', () => { }) test('the nav circle fills pink on press, and never drops', async ({ page }) => { + await page.goto('/en/help', { waitUntil: 'domcontentloaded' }) // nav board 17802:61534 draws this as a ring on the page background — // the ghost icon-only button. A shadow here would make the top nav // move 4px under the thumb, which is not a navigation gesture. @@ -129,7 +142,7 @@ test.describe('Button press physics', () => { } }) - // /shhhhh's back circle is the NavHeader one. The setup flow builds its own + // The help page's back circle is the NavHeader one. The setup flow builds its own // navigation row, and its circles were the last call site still drawing a // secondary button with the shadow stripped — a white chip on the #90a8ed // hero, which is the state the board does not have (kush QA 2026-09-21). @@ -137,19 +150,8 @@ test.describe('Button press physics', () => { // login. (/setup/finish used to, through a log-out circle that moved under // its primary in the Release 164 smoke-test fixes.) test('the setup nav circle is a ring on the hero, not a white chip', async ({ page, baseURL }) => { - // web signup is app-only; the support keep-web cookie reopens it in this browser - await page.context().addCookies([{ name: KEEP_WEB_COOKIE, value: KEEP_WEB_COOKIE_VALUE, url: baseURL! }]) - // Same-origin only. A country from ipapi.co, with no API to say what that - // country is offered, hides both sell screens, so the step after Welcome - // would depend on the runner's IP and ipapi's rate limit. - await page.route('**/*', (route) => { - const { hostname } = new URL(route.request().url()) - return hostname === '127.0.0.1' || hostname === 'localhost' ? route.continue() : route.abort() - }) - await page.goto('/setup', { waitUntil: 'domcontentloaded' }) - const signUp = page.getByRole('button', { name: 'Sign up' }) - await expect(signUp).toBeVisible({ timeout: 60_000 }) - await signUp.click() + await openSetupLanding(page, baseURL!) + await page.getByRole('button', { name: 'Sign up' }).click() await expect(page).toHaveURL(/screen=advantage-fees/) const circle = page.getByRole('button', { name: 'Go back' }) @@ -173,7 +175,8 @@ test.describe('Button press physics', () => { } }) - test('secondary turns brand pink while pressed', async ({ page }) => { + test('secondary turns brand pink while pressed', async ({ page, baseURL }) => { + await openSetupLanding(page, baseURL!) const secondary = pressable(page, 'btn-secondary') await expect(secondary).toBeVisible() diff --git a/e2e/flows/card-public.spec.ts b/e2e/flows/card-public.spec.ts index 145884d6a1..f9e34eded5 100644 --- a/e2e/flows/card-public.spec.ts +++ b/e2e/flows/card-public.spec.ts @@ -379,15 +379,18 @@ test('a signed-out visitor to /card is redirected to /setup — public access is await page.waitForURL(/\/setup/, { timeout: 10_000 }) }) -test('the public landing opens Google Play with the deferred card destination', async ({ page, context }) => { +test('the legacy /shhhhh link lands on /peanut-card and opens Google Play with the card destination', async ({ + page, + context, +}) => { await stubSignedOutApi(page) await context.route('https://play.google.com/**', (route) => route.fulfill({ body: 'Store handoff' })) - await page.goto('/shhhhh') - await expect(page.getByRole('heading', { level: 1, name: 'Peanut Card Go Pink.' })).toBeVisible() + await page.goto('/shhhhh?campaign=event-alumni') + await expect(page).toHaveURL(/\/peanut-card\?campaign=event-alumni$/) await shot(page, 'landing') const opened = page.waitForEvent('popup') - await page.getByRole('button', { name: 'Get card', exact: true }).first().click() + await page.getByRole('link', { name: 'Get your virtual card' }).first().click() const store = await opened await expect(store).toHaveURL(/^https:\/\/play\.google\.com\/store\/apps\/details\?/) const referrer = new URL(store.url()).searchParams.get('referrer') ?? '' diff --git a/e2e/shots/sweep-targets.ts b/e2e/shots/sweep-targets.ts index 55ecbe1b3a..80b7fe1b0c 100644 --- a/e2e/shots/sweep-targets.ts +++ b/e2e/shots/sweep-targets.ts @@ -296,7 +296,6 @@ export const EXTRA_APP_ROUTES: OverlayTarget[] = [ { id: 'route-recover-wallet', route: '/recover-wallet' }, { id: 'route-card', route: '/card' }, { id: 'route-card-limit', route: '/card/limit' }, - { id: 'route-card-physical', route: '/card/physical' }, { id: 'route-card-add-to-wallet', route: '/card/add-to-wallet' }, { id: 'route-card-recovery', route: '/card-recovery' }, // /points renamed to /rewards — the sweep's redirect skip caught it @@ -310,7 +309,6 @@ export const EXTRA_APP_ROUTES: OverlayTarget[] = [ // and add-money fixtures cover those screens' entry states { id: 'route-limits-bridge', route: '/limits/bridge' }, { id: 'route-kyc-success', route: '/kyc/success' }, - { id: 'route-shhhhh', route: '/shhhhh' }, ] /** the four landing pages live outside [locale] */ diff --git a/eslint.config.js b/eslint.config.js index 4470e9b39a..9e6afd198e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -486,7 +486,6 @@ module.exports = [ 'src/app/(mobile-ui)/qr-pay/page.tsx', 'src/app/(mobile-ui)/withdraw/page.tsx', 'src/app/lp/card/CardLandingPage.tsx', - 'src/app/shhhhh/ShhhhhLandingPage.tsx', 'src/components/AddWithdraw/AddWithdrawCountriesList.tsx', 'src/components/AddWithdraw/AddWithdrawRouterView.tsx', 'src/components/Claim/Link/SendLinkActionList.tsx', @@ -548,9 +547,8 @@ module.exports = [ 'src/app/(mobile-ui)/**/*.tsx', 'src/app/(setup)/**/*.tsx', // Top-level app routes sit outside the route groups above; without - // them listed the guard cannot see their copy (/shhhhh shipped - // English-only to every locale because of exactly that gap). - 'src/app/shhhhh/**/*.tsx', + // them listed the guard cannot see their copy (the old /shhhhh page + // shipped English-only to every locale because of exactly that gap). 'src/app/kyc/**/*.tsx', 'src/app/invite/**/*.tsx', 'src/components/{Home,Send,Request,Profile,Setup,Settings,Card,AddMoney,AddWithdraw,Withdraw,Claim,Payment,Points,Badges,Notifications,Invites,TransactionDetails,Kyc,IdentityVerification,ExchangeRate,Common,ForceIOSPWAInstall,User,Migration}/**/*.tsx', diff --git a/public/llms-full.txt b/public/llms-full.txt index 961f1be850..fb9a1b33cc 100644 --- a/public/llms-full.txt +++ b/public/llms-full.txt @@ -15,7 +15,7 @@ PIX is Brazil's instant payment network — ~150 million people use it daily. No MercadoPago QR is accepted at 1,000,000+ merchants in Argentina. Locals need a DNI to open an account; Peanut gives access to the payment network without one — pay in pesos with a passport-verified account. Conversion uses the cripto dólar rate (a direct dollar-to-peso market rate that beats the regulated MEP rate cards use), typically several percent to ~11% more pesos per dollar. Free, instant, rate locked at payment. ### The Peanut Card -The Peanut Card is a virtual Visa card for spending your Peanut balance wherever Visa is accepted. Complete identity verification in the app and apply; applications are subject to approval. No monthly or annual fees; a 1% Visa international service assessment applies to cross-currency purchases, and standard fees and limits apply under the cardholder terms. Get your card at https://peanut.me/shhhhh. +The Peanut Card is a virtual Visa card for spending your Peanut balance wherever Visa is accepted. Complete identity verification in the app and apply; applications are subject to approval. No monthly or annual fees; a 1% Visa international service assessment applies to cross-currency purchases, and standard fees and limits apply under the cardholder terms. Get your card at https://peanut.me/peanut-card. ## Core features @@ -61,7 +61,7 @@ Send from balance straight to any third-party bank account, and receive into the - Local QR spending live: Argentina (MercadoPago), Brazil (PIX). - Bank rails live: 36 SEPA-zone countries (EUR), US (ACH/wire), Mexico (SPEI), GBP (Faster Payments). - Crypto deposit/withdraw: global, all non-restricted countries. -- Card: apply in the app after identity verification; applications are subject to approval — https://peanut.me/shhhhh +- Card: apply in the app after identity verification; applications are subject to approval — https://peanut.me/peanut-card - Roadmap (not live): local payment methods in many more countries (CoDi, Transfiya, Yape, Bizum, MB WAY, UPI, and others). Only Argentina and Brazil have live local spending today. ## Who it's for @@ -74,6 +74,6 @@ Tourists, digital nomads, expats, remote workers, freelancers, and families movi - Twitter/X: https://x.com/joinpeanut - GitHub: https://github.com/peanutprotocol - LinkedIn: https://www.linkedin.com/company/peanut-trade/ -- Peanut Card: https://peanut.me/shhhhh +- Peanut Card: https://peanut.me/peanut-card - Careers: https://peanut.me/careers - Support: https://peanut.me/support diff --git a/public/llms.txt b/public/llms.txt index 4eefcde295..d9b862001e 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -23,7 +23,7 @@ Peanut is a self-custody money app built on digital dollars (USDC). You hold dol ## The Peanut Card -The Peanut Card is a virtual Visa card for spending your Peanut balance wherever Visa is accepted. Complete identity verification in the app and apply; applications are subject to approval. No monthly or annual fees; a 1% Visa international service assessment applies to cross-currency purchases, and standard fees and limits apply under the cardholder terms. Get your card at https://peanut.me/shhhhh. +The Peanut Card is a virtual Visa card for spending your Peanut balance wherever Visa is accepted. Complete identity verification in the app and apply; applications are subject to approval. No monthly or annual fees; a 1% Visa international service assessment applies to cross-currency purchases, and standard fees and limits apply under the cardholder terms. Get your card at https://peanut.me/peanut-card. ## Send & receive money @@ -58,7 +58,7 @@ The Peanut Card is a virtual Visa card for spending your Peanut balance wherever - **Local QR spending live now:** Argentina (MercadoPago) and Brazil (PIX). - **Bank deposit/withdraw live:** 36 SEPA-zone European countries (EUR), United States (ACH/wire), Mexico (SPEI), GBP (Faster Payments). - **Crypto deposit/withdraw:** available globally in all non-restricted countries. -- **Peanut Card:** apply in the app after identity verification; applications are subject to approval — https://peanut.me/shhhhh +- **Peanut Card:** apply in the app after identity verification; applications are subject to approval — https://peanut.me/peanut-card - **Coming soon (not live):** local QR/payment methods in many more countries — Mexico (CoDi), Colombia (Transfiya), Peru (Yape), Spain (Bizum), Portugal (MB WAY), India (UPI), and others. These are roadmap; only Argentina and Brazil have live local spending today. ## Who it's for @@ -72,7 +72,7 @@ Tourists, digital nomads, expats, remote workers, freelancers, and families movi - Pay with MercadoPago (Argentina): https://peanut.me/en/pay-with/mercadopago - Brazil guide: https://peanut.me/en/brazil - Argentina guide: https://peanut.me/en/argentina -- Peanut Card: https://peanut.me/shhhhh +- Peanut Card: https://peanut.me/peanut-card - Help center: https://peanut.me/en/help - Careers: https://peanut.me/careers - Support: https://peanut.me/support diff --git a/redirects.json b/redirects.json index e3580afffd..7a4db0783e 100644 --- a/redirects.json +++ b/redirects.json @@ -1266,9 +1266,24 @@ "destination": "/", "permanent": true }, + { + "source": "/shhhhh", + "destination": "/peanut-card", + "permanent": true + }, + { + "source": "/shhhhh/:path*", + "destination": "/peanut-card", + "permanent": true + }, + { + "source": "/card/physical", + "destination": "/card", + "permanent": false + }, { "source": "/lp/card", - "destination": "/shhhhh", + "destination": "/peanut-card", "permanent": true }, { @@ -1278,12 +1293,12 @@ }, { "source": "/sh", - "destination": "/shhhhh", + "destination": "/peanut-card", "permanent": true }, { "source": "/sh/:path*", - "destination": "/shhhhh", + "destination": "/peanut-card", "permanent": true }, { diff --git a/scripts/ds-lint-counts.mjs b/scripts/ds-lint-counts.mjs index 27de87e0e9..2083868fb5 100644 --- a/scripts/ds-lint-counts.mjs +++ b/scripts/ds-lint-counts.mjs @@ -134,7 +134,6 @@ const LEGACY_ALLOW = [ 'components/Marketing/', 'components/Jobs/', 'app/lp/', - 'app/shhhhh/', 'app/careers/', 'app/jobs/', 'app/m/', diff --git a/scripts/screen-wordiness-core.cjs b/scripts/screen-wordiness-core.cjs index ae0b8de397..0b48002334 100644 --- a/scripts/screen-wordiness-core.cjs +++ b/scripts/screen-wordiness-core.cjs @@ -19,7 +19,6 @@ const EXCLUDED_ROUTE_PREFIXES = [ 'app/careers/', 'app/m/', 'app/app/', - 'app/shhhhh/', 'app/crisp-proxy/', 'app/(mobile-ui)/quests/', 'app/api/', diff --git a/scripts/screens/inventory.mjs b/scripts/screens/inventory.mjs index c866436b89..9236279b0b 100644 --- a/scripts/screens/inventory.mjs +++ b/scripts/screens/inventory.mjs @@ -59,7 +59,7 @@ export function inventory(root, catalogue) { const screens = byRoute.get(route) ?? [] const reason = ROUTE_EXCLUSIONS.get(route) ?? - (route.startsWith('/dev') || route === '/shhhhh' + (route.startsWith('/dev') ? 'Developer tooling, outside the app catalogue' : route.startsWith('/quests') || route.startsWith('/[locale]') || diff --git a/src/app/(mobile-ui)/card/physical/page.tsx b/src/app/(mobile-ui)/card/physical/page.tsx deleted file mode 100644 index 55965eb25e..0000000000 --- a/src/app/(mobile-ui)/card/physical/page.tsx +++ /dev/null @@ -1,12 +0,0 @@ -'use client' -import { type FC } from 'react' -import ActiveCardGate from '@/components/Card/ActiveCardGate' -import PhysicalCardScreen from '@/components/Card/PhysicalCardScreen' - -const PhysicalCardPage: FC = () => ( - - {(card, onBack) => } - -) - -export default PhysicalCardPage diff --git a/src/app/(mobile-ui)/dev/ds/primitives/title-block/page.tsx b/src/app/(mobile-ui)/dev/ds/primitives/title-block/page.tsx index b849412b08..fab921a761 100644 --- a/src/app/(mobile-ui)/dev/ds/primitives/title-block/page.tsx +++ b/src/app/(mobile-ui)/dev/ds/primitives/title-block/page.tsx @@ -113,30 +113,6 @@ export default function TitleBlockPage() { - {t('onListTitle')}} - description={t('onListBody')} - align="center" - size="s" -/>`} - > -
- You're on the waiting list} - description="We'll tell you as soon as you can order it." - align="center" - size="s" - /> - -
-
- (() => false) -const mockUseGuestStoreHandoff = jest.fn() -let mockUser: { user: { userId: string } } | null = null -const callOrder: string[] = [] - -jest.mock('next/navigation', () => ({ useRouter: () => ({ push: mockPush }) })) -jest.mock('next-intl', () => ({ - useTranslations: (namespace: string) => (key: string) => { - const messages = require('@/i18n/app/messages/en.json') - return `${namespace}.${key}` - .split('.') - .reduce((value, part) => (value as Record)[part], messages) - }, -})) -jest.mock('@/context/authContext', () => ({ - useAuth: () => ({ user: mockUser, fetchUser: mockFetchUser, isFetchingUser: false }), -})) -jest.mock('@/hooks/useGuestStoreHandoff', () => ({ - useGuestStoreHandoff: (opts?: { surface?: string }) => { - mockUseGuestStoreHandoff(opts) - return { - interceptGuestCta: (handoff?: { dest?: string }) => { - callOrder.push('intercept') - return mockInterceptGuestCta(handoff) - }, - storeHandoffModal:
, - } - }, -})) -jest.mock('posthog-js', () => ({ __esModule: true, default: { capture: jest.fn() } })) -jest.mock('@sentry/nextjs', () => ({ captureException: jest.fn() })) -jest.mock('@/components/0_Bruddle/Button', () => ({ - Button: ({ - children, - onClick, - disabled, - }: { - children: React.ReactNode - onClick: () => void - disabled?: boolean - }) => ( - - ), -})) -jest.mock('@/components/Marketing/HeroBackNav', () => ({ HeroBackNav: () => null })) -jest.mock('@/components/LandingPage/marquee', () => ({ - Marquee: ({ message }: { message: string[] }) =>
{message.join(' ')}
, -})) -jest.mock('framer-motion', () => ({ - MotionConfig: ({ children }: { children?: React.ReactNode }) => <>{children}, - motion: new Proxy( - {}, - { - get: - (_target, tag: string) => - ({ children, ...props }: { children?: React.ReactNode }) => { - const Tag = tag as 'div' - const { - initial: _i, - animate: _a, - transition: _t, - whileInView: _w, - ...rest - } = props as Record - return {children} - }, - } - ), -})) -jest.mock('@/components/Card/share-asset/ScaledPixelatedCardFace', () => ({ ScaledPixelatedCardFace: () => null })) -jest.mock('@/components/Invites/badge-campaign-context', () => { - const actual = jest.requireActual('@/components/Invites/badge-campaign-context') - return { - ...actual, - queuePendingBadgeCampaigns: (...args: [readonly string[], number?]) => { - callOrder.push('queue') - return actual.queuePendingBadgeCampaigns(...args) - }, - } -}) -jest.mock('@/services/badge-campaigns', () => ({ - claimAndSettlePendingBadgeCampaigns: (...args: unknown[]) => mockClaim(...args), - isConfirmedBadgeCampaignClaim: (claim: { outcome: string }) => - ['awarded', 'already_awarded'].includes(claim.outcome), -})) - -beforeEach(() => { - jest.clearAllMocks() - callOrder.length = 0 - localStorage.clear() - window.history.replaceState(null, '', '/shhhhh') - mockUser = null - mockInterceptGuestCta.mockReturnValue(false) - mockClaim.mockResolvedValue({ claims: [], pending: [] }) -}) - -const getCard = () => { - render() - fireEvent.click(screen.getAllByRole('button', { name: 'Get card' })[0]) -} - -it('offers the public product and keeps a guest card destination through signup', async () => { - getCard() - // the wordmark is part of the h1, so search engines read the product name - expect(screen.getByRole('heading', { level: 1, name: 'Peanut Card Go Pink.' })).toBeInTheDocument() - expect(screen.queryByText(/waitlist|closed beta|try the door/i)).not.toBeInTheDocument() - // the honesty beat and the door marquee came back from the old page - expect(screen.getByRole('heading', { level: 2, name: 'Probably not for you.' })).toBeInTheDocument() - expect(screen.getAllByTestId('marquee')).toHaveLength(5) - expect(screen.getAllByTestId('marquee')[0]).toHaveTextContent('PEANUT CARD CONTACTLESS GET YOUR CARD') - await waitFor(() => expect(mockPush).toHaveBeenCalledWith('/setup?redirect_uri=%2Fcard')) -}) - -it('publishes the visible FAQ as FAQPage structured data', () => { - const { container } = render() - const script = container.querySelector('script[type="application/ld+json"]') - const schema = JSON.parse(script!.innerHTML) - expect(schema['@type']).toBe('FAQPage') - expect(schema.mainEntity).toHaveLength(7) - // the rendered answer and the structured one must be the same sentence - const first = schema.mainEntity[0] - expect(screen.getByText(first.name)).toBeInTheDocument() - expect(screen.getByText(first.acceptedAnswer.text)).toBeInTheDocument() -}) - -it('opens a signed-in account directly at /card', async () => { - mockUser = { user: { userId: 'ordinary-user' } } - getCard() - await waitFor(() => expect(mockPush).toHaveBeenCalledWith('/card')) - expect(mockClaim).not.toHaveBeenCalled() -}) - -it('preserves campaign signup attribution with an unconditional card destination', async () => { - window.history.replaceState(null, '', '/shhhhh?campaign=event-alumni') - getCard() - await waitFor(() => expect(mockPush).toHaveBeenCalledWith('/setup?step=signup&redirect_uri=%2Fcard')) - expect(getRedirectUrl()).toBe('/card') - expect(mockClaim).not.toHaveBeenCalled() -}) - -it.each(['awarded', 'inactive', 'unknown', 'retryable'])( - 'campaign outcome %s does not gate a card application', - async (outcome) => { - mockUser = { user: { userId: 'ordinary-user' } } - window.history.replaceState(null, '', '/shhhhh?campaign=event-alumni') - mockClaim.mockResolvedValue({ claims: [{ badgeCampaign: 'event-alumni', outcome }], pending: [] }) - getCard() - await waitFor(() => expect(mockPush).toHaveBeenCalledWith('/card')) - if (outcome === 'awarded') expect(mockFetchUser).toHaveBeenCalledTimes(1) - } -) - -it('opens the card even when a campaign claim is temporarily unavailable', async () => { - mockUser = { user: { userId: 'ordinary-user' } } - window.history.replaceState(null, '', '/shhhhh?campaign=event-alumni') - mockClaim.mockRejectedValue(new Error('temporary transport failure')) - getCard() - await waitFor(() => expect(mockPush).toHaveBeenCalledWith('/card')) -}) - -describe('pwa-sunset store hand-off', () => { - it('hands a guest to the store with /card instead of web signup', async () => { - mockInterceptGuestCta.mockReturnValue(true) - getCard() - await waitFor(() => expect(mockInterceptGuestCta).toHaveBeenCalledWith({ dest: '/card' })) - expect(mockPush).not.toHaveBeenCalled() - expect(screen.getByTestId('store-handoff')).toBeInTheDocument() - }) - - it('queues the campaign tag before handing off, so it rides the deferred link', async () => { - mockInterceptGuestCta.mockReturnValue(true) - window.history.replaceState(null, '', '/shhhhh?campaign=event-alumni') - getCard() - await waitFor(() => expect(callOrder).toEqual(['queue', 'intercept'])) - expect(mockPush).not.toHaveBeenCalled() - }) - - it('never intercepts a signed-in visitor', async () => { - mockUser = { user: { userId: 'ordinary-user' } } - mockInterceptGuestCta.mockReturnValue(true) - getCard() - await waitFor(() => expect(mockPush).toHaveBeenCalledWith('/card')) - expect(mockInterceptGuestCta).not.toHaveBeenCalled() - }) -}) diff --git a/src/app/shhhhh/ShhhhhLandingPage.tsx b/src/app/shhhhh/ShhhhhLandingPage.tsx deleted file mode 100644 index eef2eb2a6e..0000000000 --- a/src/app/shhhhh/ShhhhhLandingPage.tsx +++ /dev/null @@ -1,290 +0,0 @@ -'use client' - -import { useState } from 'react' -import { useRouter } from 'next/navigation' -import { motion, MotionConfig } from 'framer-motion' -import posthog from 'posthog-js' -import { useTranslations } from 'next-intl' -import { captureException } from '@sentry/nextjs' -import { Button } from '@/components/0_Bruddle/Button' -import { FAQsPanel } from '@/components/Global/FAQs' -import { ProductSplitHero } from '@/components/Marketing/ProductSplitHero' -import { Marquee } from '@/components/LandingPage/marquee' -import { JsonLd } from '@/components/Marketing/JsonLd' -import { ScaledPixelatedCardFace } from '@/components/Card/share-asset/ScaledPixelatedCardFace' -import { Sparkle, Star } from '@/assets/illustrations' -import { useAuth } from '@/context/authContext' -import { faqSchema } from '@/lib/seo/schemas' -import { ANALYTICS_EVENTS } from '@/constants/analytics.consts' -import { MIGRATION_SURFACES } from '@/constants/migration.consts' -import { useGuestStoreHandoff } from '@/hooks/useGuestStoreHandoff' -import { badgeCampaignsFromSearchParams, queuePendingBadgeCampaigns } from '@/components/Invites/badge-campaign-context' -import { claimAndSettlePendingBadgeCampaigns, isConfirmedBadgeCampaignClaim } from '@/services/badge-campaigns' -import { queueShhhhhCampaignContinuation, shhhhhCampaignSignupRoute } from './shhhhh-acquisition' -import { CTA_MOTION } from '@/components/Marketing/constants' - -const faqKeys = ['q1', 'q2', 'q3', 'q5', 'q6', 'q7', 'q8'] as const - -// "150 million merchants" is on the issuer's allowed acceptance list; the -// other three are product facts. Values are numerals, so they need no locale. -const stats = [ - { value: '150M+', labelKey: 'statMerchants' }, - { value: '1', labelKey: 'statBalance' }, - { value: '0', labelKey: 'statMonthlyFees' }, - { value: '0', labelKey: 'statAnnualFees' }, -] as const - -const steps = ['signIn', 'verify', 'spend'] as const - -const sectionTitleClass = 'font-roboto-flex-extrabold text-heading font-extraBlack uppercase md:text-headingMedium' - -/** Keep existing campaign links usable while card applications are public. */ -export default function ShhhhhLandingPage() { - const t = useTranslations('shhhhh') - const { user, fetchUser, isFetchingUser } = useAuth() - const router = useRouter() - const [busy, setBusy] = useState(false) - - // During migration, web guests install the app and continue to /card after signup. - const { interceptGuestCta, storeHandoffModal } = useGuestStoreHandoff({ - surface: MIGRATION_SURFACES.LANDING_DOOR, - trackImpressionWhenGuest: !isFetchingUser && !user, - }) - - const handleCTA = async () => { - // wait for auth so returning users are not sent to signup or the store - if (busy || isFetchingUser) return - setBusy(true) - const campaigns = badgeCampaignsFromSearchParams(new URLSearchParams(window.location.search)) - posthog.capture(ANALYTICS_EVENTS.CARD_APPLICATION_CTA_CLICKED, { signed_in: !!user, campaign_tags: campaigns }) - try { - // save campaigns before the store handoff: buildDeferredPayload reads this cookie queue - const queued = campaigns.length > 0 ? queuePendingBadgeCampaigns(campaigns, 30) : [] - if (!user && interceptGuestCta({ dest: '/card' })) return - if (campaigns.length > 0) { - if (!user) { - queueShhhhhCampaignContinuation() - router.push(shhhhhCampaignSignupRoute()) - return - } - try { - const batch = await claimAndSettlePendingBadgeCampaigns(queued) - const confirmed = batch.claims.filter(isConfirmedBadgeCampaignClaim) - if (confirmed.length > 0) { - posthog.capture(ANALYTICS_EVENTS.INVITE_ACCEPTED, { - campaign_tags: confirmed.map((claim) => claim.badgeCampaign), - }) - await fetchUser() - } - if (batch.pending.length > 0) { - captureException(new Error('Card landing campaign claim retained for retry'), { - tags: { error_type: 'campaign_claim_retryable' }, - extra: { pendingCampaigns: batch.pending, claims: batch.claims }, - }) - } - } catch (error) { - captureException(error, { tags: { error_type: 'campaign_claim_unexpected_failure' } }) - } - } - // Campaign awards do not decide whether someone can apply for a card. - router.push(user ? '/card' : `/setup?redirect_uri=${encodeURIComponent('/card')}`) - } finally { - setBusy(false) - } - } - - // The strip between sections repeats the card's five words. - const marqueeWords = [ - t('marquee.peanutCard'), - t('marquee.contactless'), - t('marquee.available'), - t('marquee.online'), - t('marquee.noMonthlyFee'), - ] - - // The page is the only card FAQ crawlers see, so mirror the visible copy into FAQPage - // structured data from the same keys and strings. - const faqJsonLd = faqSchema( - faqKeys.map((key) => ({ question: t(`faq.${key}.question`), answer: t(`faq.${key}.answer`) })) - ) - - return ( - // The decorations are pure garnish, so the springs stop for anyone who - // asked the OS for less motion. - - {faqJsonLd && } - {/* §1 — Hero (pink): the canonical sub-LP split hero */} - - {t('hero.cta')} - - } - art={ -
- -
- } - disclaimer={t('hero.disclaimer')} - /> - - - - {/* §2 — What it does (yellow) */} -
-
-

- {t('whatItDoes.titleLine1')} -
- {t('whatItDoes.titleLine2')} -

-

- {t('whatItDoes.body')} -

-
- {stats.map(({ value, labelKey }) => ( -
-
- {value} -
-
- {t(`whatItDoes.${labelKey}`)} -
-
- ))} -
-
-
- - - - {/* §3 — Who it's for (pink) */} -
- -
-

{t('whoItsFor.title')}

-

{t('whoItsFor.body')}

-
-
- - {/* §4 — Probably not for you (black): the honesty beat pairs with §3, - so no strip between them. */} -
-
-

{t('notForYou.title')}

-

{t('notForYou.body1')}

-

- {t('notForYou.body2')} -

-
-
- - - - {/* §5 — How to get it (white) */} -
-
-

{t('howToApply.title')}

-
    - {steps.map((step) => ( -
  1. -
    - {t(`howToApply.${step}Title`)} -
    -

    {t(`howToApply.${step}Body`)}

    -
  2. - ))} -
-
-
- - - - {/* §6 — FAQ: the shared marketing fold on cream. - The page exemption covers its grounds and look, not a hand-rolled - FAQ widget — the bespoke one shipped without a focus ring. */} - ({ - id: key, - question: t(`faq.${key}.question`), - answer: t(`faq.${key}.answer`), - }))} - /> - - - - {/* §7 — Ready? (black) */} -
- - -
-

- {t('ready.title')} -

-

- {t('ready.subtitle')} -

- {/* Primary here on purpose: the brand fill pops on the black - closer, while the hero stays secondary because its background - is that same fill. */} - -

- {t('ready.disclaimer')} -

-
-
- {storeHandoffModal} - - ) -} diff --git a/src/app/shhhhh/__tests__/page.test.tsx b/src/app/shhhhh/__tests__/page.test.tsx deleted file mode 100644 index 2d41d899b6..0000000000 --- a/src/app/shhhhh/__tests__/page.test.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { renderToString } from 'react-dom/server' -import { screen, within } from '@testing-library/react' -import ShhhhhPage from '../page' - -jest.mock('react-dom/server', () => jest.requireActual('react-dom/server.node')) -jest.mock('../ShhhhhLandingPage', () => ({ __esModule: true, default: () =>
Peanut Card
})) -jest.mock('@/components/Global/FooterVisibilityObserver', () => ({ FooterVisibilityObserver: () => null })) -jest.mock('next/image', () => ({ - __esModule: true, - default: ({ alt }: { alt: string }) => {alt}, -})) - -afterEach(() => { - document.body.innerHTML = '' -}) - -it('server-renders country-neutral navigation on the legacy card entry', () => { - document.body.innerHTML = renderToString() - const navigation = screen.getByRole('navigation', { name: 'Features' }) - - expect( - within(navigation) - .getAllByRole('link') - .map((link) => link.getAttribute('href')) - ).toEqual(['/request-links', '/self-custody', '/peanut-card', '/lp#footer-features']) - expect(screen.queryByRole('button', { name: /^Language:/ })).not.toBeInTheDocument() - expect(screen.queryByRole('link', { name: /^Status$/ })).not.toBeInTheDocument() -}) diff --git a/src/app/shhhhh/page.tsx b/src/app/shhhhh/page.tsx deleted file mode 100644 index a6314b4413..0000000000 --- a/src/app/shhhhh/page.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { generateMetadata as generateMeta } from '@/app/metadata' -import { LandingPageShell } from '@/components/LandingPage/LandingPageShell' -import Footer from '@/components/LandingPage/Footer' -import ShhhhhLandingPage from './ShhhhhLandingPage' - -export const metadata = generateMeta({ - title: 'Peanut Card | Get your card', - description: - 'Get your Peanut Card for online payments, and contactless with Apple Pay or Google Pay where supported. Verification and approval required.', - keywords: 'peanut card, visa-accepting merchants, virtual card, stablecoins', - canonical: '/shhhhh', -}) - -export default function ShhhhhPage() { - return ( - - -