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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 />} />
|
||||
|
||||
Reference in New Issue
Block a user