New UI for public booking
This commit is contained in:
@@ -3,7 +3,7 @@ import { NotFoundPage } from '@/features/not-found/not-found-page';
|
||||
import { ServerErrorPage } from '@/features/server-error/server-error-page';
|
||||
import type { ApiClient } from '@/lib/api-client';
|
||||
import type { AuthContextValue } from '@/lib/auth';
|
||||
import { Outlet, createRootRouteWithContext } from '@tanstack/react-router';
|
||||
import { Outlet, createRootRouteWithContext, useLocation } from '@tanstack/react-router';
|
||||
|
||||
type RouterContext = {
|
||||
auth: AuthContextValue;
|
||||
@@ -17,6 +17,13 @@ export const Route = createRootRouteWithContext<RouterContext>()({
|
||||
});
|
||||
|
||||
function RootRoute() {
|
||||
const location = useLocation();
|
||||
const isPublicBookingRoute = /^\/[^/]+\/booking(?:\/|$)/.test(location.pathname);
|
||||
|
||||
if (isPublicBookingRoute) {
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<div className="flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user