From 3791af86442763502a2827e8d7039836cf9aad59 Mon Sep 17 00:00:00 2001 From: Riddhesh Mahajan <40472653+riddhesh-mahajan@users.noreply.github.com> Date: Thu, 4 Jan 2024 21:58:23 +0530 Subject: [PATCH] feat: Make private URLs easier to copy-paste from web app (#13018) * Make private URLs easier to copy-paste from web app * Apply suggestions from code review * Update apps/web/pages/event-types/index.tsx * lint --------- Co-authored-by: Peer Richelsen Co-authored-by: Peer Richelsen --- apps/web/pages/event-types/index.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index b068c7d687..ce15cea75f 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -19,6 +19,7 @@ import { TeamsFilter } from "@calcom/features/filters/components/TeamsFilter"; import { getTeamsFiltersFromQuery } from "@calcom/features/filters/lib/getTeamsFiltersFromQuery"; import { ShellMain } from "@calcom/features/shell/Shell"; import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants"; +import { CAL_URL } from "@calcom/lib/constants"; import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import useMediaQuery from "@calcom/lib/hooks/useMediaQuery"; @@ -66,6 +67,7 @@ import { Trash, Upload, Users, + VenetianMask, } from "@calcom/ui/components/icon"; import useMeQuery from "@lib/hooks/useMeQuery"; @@ -388,6 +390,8 @@ export const EventTypeList = ({ {types.map((type, index) => { const embedLink = `${group.profile.slug}/${type.slug}`; const calLink = `${bookerUrl}/${embedLink}`; + const isPrivateURLEnabled = type.hashedLink?.link; + const placeholderHashedLink = `${CAL_URL}/d/${type.hashedLink?.link}/${type.slug}`; const isManagedEventType = type.schedulingType === SchedulingType.MANAGED; const isChildrenManagedEventType = type.metadata?.managedEventConfig !== undefined && type.schedulingType !== SchedulingType.MANAGED; @@ -465,6 +469,20 @@ export const EventTypeList = ({ }} /> + + {isPrivateURLEnabled && ( + +