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.

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-14 11:10:47 +00:00
parent 6f44481ff8
commit ae1cc8dcfb
2 changed files with 5 additions and 0 deletions

View File

@@ -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
}

View File

@@ -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 (
<MarketingLayout>
<ScrollToTop />
<Suspense fallback={<LoadingPage />}>
<Routes>
<Route path="/" element={<Home />} />