// ------------------------------------------------------------------------ // components/SubscribeModal.js - SunScope Extra upsell popup. // // Replaces the old inline pro-prompt box. Shown when a free user taps a // locked day, profile, or feature. Presents the upsell copy plus Subscribe / // Restore / Manage links. Easy to dismiss: ×, backdrop click, or Esc. // // Reuses the .welcome-* overlay/card styling. Purely presentational - the // open/close state is proPromptDay in useAppState, dismissed via onClose. // // Props: // title - upsell heading (e.g. "Hiking is part of SunScope Extra") // detail - supporting paragraph // onClose - dismiss the prompt (clears proPromptDay) // openRestore - opens the "Already subscribed?" restore modal // ------------------------------------------------------------------------ import { h } from '../../vendor/preact.js'; import { useEffect } from '../../vendor/preact-hooks.js'; import htm from '../../vendor/htm.js'; import { Wordmark } from './Wordmark.js'; const html = htm.bind(h); const SUBSCRIBE_URL = 'https://buy.stripe.com/9B63cw7vl8k15Ei9DQd7q00'; const MANAGE_URL = 'https://billing.stripe.com/p/login/9B63cw7vl8k15Ei9DQd7q00'; export function SubscribeModal({ title, detail, onClose, openRestore }) { // Dismiss on Esc. useEffect(() => { const onKey = (e) => { if (e.key === 'Escape') onClose(); }; document.addEventListener('keydown', onKey); return () => document.removeEventListener('keydown', onKey); }, [onClose]); const secondaryLink = { fontFamily: 'Manrope, sans-serif', fontWeight: 700, fontSize: '10px', textTransform: 'uppercase', letterSpacing: '0.07em', textDecoration: 'none', background: 'none', border: 'none', cursor: 'pointer', }; return html`
`; }