From 8171a190a7b30fa3109a13dd66d3f2e7dbfec88b Mon Sep 17 00:00:00 2001 From: vsxd Date: Fri, 13 Mar 2026 11:37:22 +0800 Subject: [PATCH] fix(web): prevent landing page from matching nested routes --- web/src/app/layout.tsx | 7 ++----- web/src/app/router.tsx | 8 -------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index f2478a8b..ff1e4814 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -1,6 +1,7 @@ import { Suspense } from 'react' import { Outlet, Link, useRouterState } from '@tanstack/react-router' import { useAuth } from '@/features/auth/use-auth' +import { LandingPage } from '@/pages/landing' export function Layout() { const { user, isLoading } = useAuth() @@ -8,11 +9,7 @@ export function Layout() { const isLanding = pathname === '/' if (isLanding) { - return ( - - - - ) + return } return ( diff --git a/web/src/app/router.tsx b/web/src/app/router.tsx index 788d8309..c6576ba8 100644 --- a/web/src/app/router.tsx +++ b/web/src/app/router.tsx @@ -15,7 +15,6 @@ function lazyRouteComponent>( return LazyComponent } -const LandingPage = lazyRouteComponent(() => import('@/pages/landing'), 'LandingPage') const HomePage = lazyRouteComponent(() => import('@/pages/home'), 'HomePage') const LoginPage = lazyRouteComponent(() => import('@/pages/login'), 'LoginPage') const RegisterPage = lazyRouteComponent(() => import('@/pages/register'), 'RegisterPage') @@ -43,12 +42,6 @@ const rootRoute = createRootRoute({ component: Layout, }) -const homeRoute = createRoute({ - getParentRoute: () => rootRoute, - path: '/', - component: LandingPage, -}) - const skillsRoute = createRoute({ getParentRoute: () => rootRoute, path: '/skills', @@ -303,7 +296,6 @@ const adminAuditLogRoute = createRoute({ }) const routeTree = rootRoute.addChildren([ - homeRoute, skillsRoute, loginRoute, registerRoute,