cal.pub0.org/apps/web/lib/hooks/usePublicPage.ts

10 lines
271 B
TypeScript
Raw Normal View History

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