From ae1cc8dcfb891c0901a497d688833ffbf6b0d8f8 Mon Sep 17 00:00:00 2001 From: "IGNY8 VPS (Salman)" Date: Fri, 14 Nov 2025 11:10:47 +0000 Subject: [PATCH] Enhance marketing site routing and add ScrollToTop component. Updated Caddyfile to support SPA routing with fallback to marketing.html. Integrated ScrollToTop in MarketingApp for improved navigation experience. --- frontend/Caddyfile.marketing | 3 +++ frontend/src/marketing/MarketingApp.tsx | 2 ++ 2 files changed, 5 insertions(+) diff --git a/frontend/Caddyfile.marketing b/frontend/Caddyfile.marketing index 1f4458c7..b820709d 100644 --- a/frontend/Caddyfile.marketing +++ b/frontend/Caddyfile.marketing @@ -13,7 +13,10 @@ } # Marketing site is the public default + # For SPA routing: serve the file if it exists, otherwise serve marketing.html + # This allows direct URL access (e.g., /product, /pricing) and browser back/forward navigation handle { + # Try to serve the requested file, fallback to marketing.html for all routes try_files {path} /marketing.html file_server } diff --git a/frontend/src/marketing/MarketingApp.tsx b/frontend/src/marketing/MarketingApp.tsx index 83ac86ad..a5ca516c 100644 --- a/frontend/src/marketing/MarketingApp.tsx +++ b/frontend/src/marketing/MarketingApp.tsx @@ -2,6 +2,7 @@ import React, { Suspense, lazy } from "react"; import { Route, Routes } from "react-router-dom"; import MarketingLayout from "./layout/MarketingLayout"; import LoadingPage from "./components/LoadingPage"; +import { ScrollToTop } from "../components/common/ScrollToTop"; const Home = lazy(() => import("./pages/Home")); const Product = lazy(() => import("./pages/Product")); @@ -17,6 +18,7 @@ const Waitlist = lazy(() => import("./pages/Waitlist")); const MarketingApp: React.FC = () => { return ( + }> } />