From 27560a078c03988064a0b629fc5a24c5c01a1b9a Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Fri, 14 Aug 2026 01:13:46 -0400 Subject: [PATCH] feat: integrate Plausible analytics script and adjust routing for marketing site --- index.html | 22 ++++++++++++++++++++++ src/MarketingApp.jsx | 20 +++++++++++++------- src/main.jsx | 7 +++++-- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 93cec0b..035f40f 100644 --- a/index.html +++ b/index.html @@ -16,6 +16,28 @@ + + +
diff --git a/src/MarketingApp.jsx b/src/MarketingApp.jsx index 4f862fb..9f1d182 100644 --- a/src/MarketingApp.jsx +++ b/src/MarketingApp.jsx @@ -23,6 +23,9 @@ const AppRedirect = () => { const router = createBrowserRouter([ { path: '/', element: }, + // Mirrors the app router, where /welcome is the canonical Landing path — + // without it this falls through to AppRedirect and bounces to /login. + { path: '/welcome', element: }, { path: '/privacy', element: }, { path: '/terms', element: }, { path: '*', element: }, @@ -50,17 +53,20 @@ const ThemeClass = () => { return null } +// Same ordering constraint as contexts/Contexts.jsx: ThemeContext reads the +// active language via useLocalization() to pick the text direction, so +// LocalizationProvider has to sit above it. const MarketingApp = () => ( - - - - + + + + - - - + + + ) export default MarketingApp diff --git a/src/main.jsx b/src/main.jsx index 0aefb3d..e2ea75c 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -5,10 +5,13 @@ import React from 'react' import ReactDOM from 'react-dom/client' const marketingHosts = new Set(['donetick.com', 'www.donetick.com']) +// ?site=marketing works in every build, not just dev, so preview deploys on +// *.pages.dev can exercise the marketing bundle. Landing on the app host with +// the flag set just renders the marketing pages — nothing sensitive is gated +// on this. const isMarketingSite = marketingHosts.has(window.location.hostname) || - (import.meta.env.DEV && - new URLSearchParams(window.location.search).get('site') === 'marketing') + new URLSearchParams(window.location.search).get('site') === 'marketing' export const Site = React.lazy(() => isMarketingSite ? import('./MarketingApp.jsx') : import('./Application.jsx'),