newsletter: site-wide signup modal with 7-day dismiss
Renders on every page via root layout. Behavior: - 5s delay after first paint so it doesn't slam the user. - Animates from a pill into the full card (bb-modal-pop keyframe); respects prefers-reduced-motion. - Heading "Get the latest in broadcast & media", email field, Subscribe + "Not now" + close (X). - Subscribe POSTs to the existing /api/newsletter/subscribe route (native system — newsletter_subscribers table + SMTP welcome via Mailcow/SMTP2GO). Listmonk wasn't installed anywhere on the infra; switching to it later is a one-line URL change. - "Not now" + backdrop click + Escape + X all dismiss for 7 days via localStorage["bb_newsletter_dismissed"]. - On success → "Check your email" panel + auto-close at 4s; subscribed flag stored in localStorage so the modal never re-prompts that visitor. Styling matches the site's dark-navy + electric-blue palette (NOT the neon ticker palette). No layout/page shifts — overlay only.
This commit is contained in:
@@ -5,6 +5,7 @@ import SystemStatusBar from '@/components/SystemStatusBar';
|
||||
import AskBBAI from '@/components/AskBBAI';
|
||||
import GoogleAnalytics from '@/components/GoogleAnalytics';
|
||||
import CookieConsent from '@/components/CookieConsent';
|
||||
import NewsletterModal from '@/components/NewsletterModal';
|
||||
|
||||
export const viewport: Viewport = {
|
||||
width: 'device-width',
|
||||
@@ -135,6 +136,7 @@ export default function RootLayout({
|
||||
{children}
|
||||
</div>
|
||||
<CookieConsent />
|
||||
<NewsletterModal />
|
||||
<AskBBAI />
|
||||
</body>
|
||||
</html>);
|
||||
|
||||
Reference in New Issue
Block a user