Refactor header and layout components, remove About page, and introduce Background component for improved UI structure
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Background } from '@/components/background';
|
||||
import { Layout } from '@/components/layout';
|
||||
import { NotFoundPage } from '@/features/not-found/not-found-page';
|
||||
import { ServerErrorPage } from '@/features/server-error/server-error-page';
|
||||
@@ -16,14 +17,27 @@ export const Route = createRootRouteWithContext<RouterContext>()({
|
||||
notFoundComponent: NotFoundPage,
|
||||
});
|
||||
|
||||
const AUTH_PAGE_REGEX =
|
||||
/^\/(login|select-complex|reset-password|onboard|invite|auth-callback)(?:\/|$)/;
|
||||
|
||||
function RootRoute() {
|
||||
const location = useLocation();
|
||||
const isPublicBookingRoute = /^\/[^/]+\/booking(?:\/|$)/.test(location.pathname);
|
||||
const isAuthPage = AUTH_PAGE_REGEX.test(location.pathname);
|
||||
|
||||
if (isPublicBookingRoute) {
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
if (isAuthPage) {
|
||||
return (
|
||||
<div className="relative min-h-dvh overflow-x-hidden bg-background text-foreground">
|
||||
<Background />
|
||||
<Outlet />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<div className="flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user