fix(web): render sidebar on settings route
Settings page was rendering Outlet directly, omitting the Sidebar nav. Adds a playwright e2e test asserting sidebar visibility on both dashboard and settings routes.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createRootRoute, Outlet, redirect, useRouter } from "@tanstack/react-router";
|
||||
import { createRootRoute, Outlet, redirect } from "@tanstack/react-router";
|
||||
import { useEffect } from "react";
|
||||
import { Sidebar } from "@/components/layout/Sidebar";
|
||||
import { loadConfig } from "@/lib/config";
|
||||
@@ -7,17 +7,10 @@ import { applyTheme, getStoredTheme } from "@/lib/theme";
|
||||
const SETTINGS_PATH = "/settings";
|
||||
|
||||
function RootLayout() {
|
||||
const router = useRouter();
|
||||
const isSettings = router.state.location.pathname === SETTINGS_PATH;
|
||||
|
||||
useEffect(() => {
|
||||
applyTheme(getStoredTheme());
|
||||
}, []);
|
||||
|
||||
if (isSettings) {
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="flex h-screen w-full overflow-hidden"
|
||||
|
||||
Reference in New Issue
Block a user