From 3c3564f884a161672e1645d679b26ca41092b617 Mon Sep 17 00:00:00 2001 From: Leo Giovanetti Date: Thu, 10 Aug 2023 13:30:33 -0300 Subject: [PATCH] fix: copy or view profile URL for org (#10702) --- packages/features/shell/Shell.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx index 10b9a70772..d25aeccc37 100644 --- a/packages/features/shell/Shell.tsx +++ b/packages/features/shell/Shell.tsx @@ -12,6 +12,7 @@ import { useIsEmbed } from "@calcom/embed-core/embed-iframe"; import UnconfirmedBookingBadge from "@calcom/features/bookings/UnconfirmedBookingBadge"; import ImpersonatingBanner from "@calcom/features/ee/impersonation/components/ImpersonatingBanner"; import { OrgUpgradeBanner } from "@calcom/features/ee/organizations/components/OrgUpgradeBanner"; +import { getOrgFullDomain } from "@calcom/features/ee/organizations/lib/orgDomains"; import HelpMenuItem from "@calcom/features/ee/support/components/HelpMenuItem"; import { TeamsUpgradeBanner } from "@calcom/features/ee/teams/components"; import { useFlagMap } from "@calcom/features/flags/context/provider"; @@ -788,9 +789,6 @@ function SideBarContainer({ bannersHeight }: SideBarContainerProps) { return ; } -const getOrganizationUrl = (slug: string) => - `${slug}.${process.env.NEXT_PUBLIC_WEBSITE_URL?.replace?.(/http(s*):\/\//, "")}`; - function SideBar({ bannersHeight, user }: SideBarProps) { const { t, isLocaleReady } = useLocale(); const orgBranding = useOrgBranding(); @@ -798,7 +796,7 @@ function SideBar({ bannersHeight, user }: SideBarProps) { const publicPageUrl = useMemo(() => { if (!user?.organizationId) return `${process.env.NEXT_PUBLIC_WEBSITE_URL}/${user?.username}`; - const publicPageUrl = orgBranding?.slug ? getOrganizationUrl(orgBranding?.slug) : ""; + const publicPageUrl = orgBranding?.slug ? getOrgFullDomain(orgBranding.slug) : ""; return publicPageUrl; }, [orgBranding?.slug, user?.organizationId, user?.username]);