From cb57aa9381ea8172b8f38493d4d992dd1bd32b50 Mon Sep 17 00:00:00 2001 From: Anthony Volk Date: Wed, 5 Nov 2025 19:11:15 +0000 Subject: [PATCH] feat: Add generic iframe component, US SNAP map --- app/src/Router.tsx | 18 ++++++++++++++++++ app/src/components/IframeContent.tsx | 18 ++++++++++++++++++ app/src/pages/SNAPMap.page.tsx | 5 +++++ app/src/routing/guards/USOnlyGuard.tsx | 15 +++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 app/src/components/IframeContent.tsx create mode 100644 app/src/pages/SNAPMap.page.tsx create mode 100644 app/src/routing/guards/USOnlyGuard.tsx diff --git a/app/src/Router.tsx b/app/src/Router.tsx index 11da7181..a7d2f96b 100644 --- a/app/src/Router.tsx +++ b/app/src/Router.tsx @@ -15,12 +15,14 @@ import PrivacyPage from './pages/Privacy.page'; import ReportOutputPage from './pages/ReportOutput.page'; import ReportsPage from './pages/Reports.page'; import SimulationsPage from './pages/Simulations.page'; +import SNAPMapPage from './pages/SNAPMap.page'; import SupportersPage from './pages/Supporters.page'; import TeamPage from './pages/Team.page'; import TermsPage from './pages/Terms.page'; import { CountryGuard } from './routing/guards/CountryGuard'; import { MetadataGuard } from './routing/guards/MetadataGuard'; import { MetadataLazyLoader } from './routing/guards/MetadataLazyLoader'; +import { USOnlyGuard } from './routing/guards/USOnlyGuard'; import { RedirectToCountry } from './routing/RedirectToCountry'; import { RedirectToLegacy } from './routing/RedirectToLegacy'; @@ -31,6 +33,7 @@ const router = createBrowserRouter( // Dynamically detect and redirect to user's country element: , }, + // US-specific routes { path: '/:countryId', element: , @@ -150,6 +153,21 @@ const router = createBrowserRouter( }, ], }, + // US-only routes + { + element: , + children: [ + { + element: , + children: [ + { + path: 'snap-map', + element: , + }, + ], + }, + ], + }, // Legacy routes - redirect to legacy.policyengine.org { children: [ diff --git a/app/src/components/IframeContent.tsx b/app/src/components/IframeContent.tsx new file mode 100644 index 00000000..99eed3ad --- /dev/null +++ b/app/src/components/IframeContent.tsx @@ -0,0 +1,18 @@ +interface IframeContentProps { + url: string; +} + +export default function IframeContent({ url }: IframeContentProps) { + return ( +