Files
cal.diy/apps/web/lib/hooks/usePublicPage.ts
T
b7851e6e53 refactor: next/router hooks with next/navigation hooks (#9105)
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Bailey Pumfleet <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
2023-08-02 11:35:48 +02:00

10 lines
275 B
TypeScript

import { usePathname } from "next/navigation";
export default function usePublicPage() {
const pathname = usePathname();
const isPublicPage = ["/[user]", "/booking", "/cancel", "/reschedule"].find((route) =>
pathname?.startsWith(route)
);
return isPublicPage;
}