* No batching on getting session * Fix usePublicPage hook to use new router search params * Move things so getSchedule data can be load as soon as we are rendering BookerComponent * pre fetch session * Removed custom code in favour of useTimePreferences --------- Co-authored-by: Alex van Andel <me@alexvanandel.com>
13 lines
445 B
TypeScript
13 lines
445 B
TypeScript
import { usePathname, useSearchParams } from "next/navigation";
|
|
|
|
export default function useIsBookingPage() {
|
|
const pathname = usePathname();
|
|
const isBookingPage = ["/booking", "/cancel", "/reschedule"].some((route) => pathname?.startsWith(route));
|
|
|
|
const searchParams = useSearchParams();
|
|
const userParam = searchParams.get("user");
|
|
const teamParam = searchParams.get("team");
|
|
|
|
return !!(isBookingPage || userParam || teamParam);
|
|
}
|