From d2352da54b0e839cf0cf1f5df417f5e4195e8f3c Mon Sep 17 00:00:00 2001 From: Nafees Nazik <84864519+G3root@users.noreply.github.com> Date: Mon, 20 Mar 2023 17:11:03 +0530 Subject: [PATCH] fix: remove cal.com from title when branding is disabled (#7827) Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Peer Richelsen --- .../components/booking/pages/AvailabilityPage.tsx | 1 + packages/ui/components/head-seo/HeadSeo.tsx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index a10d6c8a96..557dd01481 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -154,6 +154,7 @@ const AvailabilityPage = ({ profile, eventType, ...restProps }: Props) => { nofollow: eventType.hidden, noindex: eventType.hidden, }} + isBrandingHidden={restProps.isBrandingHidden} /> diff --git a/packages/ui/components/head-seo/HeadSeo.tsx b/packages/ui/components/head-seo/HeadSeo.tsx index 81c01203eb..4d6a5e91bd 100644 --- a/packages/ui/components/head-seo/HeadSeo.tsx +++ b/packages/ui/components/head-seo/HeadSeo.tsx @@ -19,6 +19,7 @@ export type HeadSeoProps = { nextSeoProps?: NextSeoProps; app?: AppImageProps; meeting?: MeetingImageProps; + isBrandingHidden?: boolean; }; /** @@ -82,11 +83,20 @@ export const HeadSeo = (props: HeadSeoProps): JSX.Element => { // Set the default URL to either the current URL (if self-hosted) or https://cal.com canonical URL const defaultUrl = isCalcom ? calcomCanonical : url; - const { title, description, siteName, canonical = defaultUrl, nextSeoProps = {}, app, meeting } = props; + const { + title, + description, + siteName, + canonical = defaultUrl, + nextSeoProps = {}, + app, + meeting, + isBrandingHidden, + } = props; const image = getSeoImage("ogImage") + constructGenericImage({ title, description }); const truncatedDescription = truncateOnWord(description, 158); - const pageTitle = title + " | " + APP_NAME; + const pageTitle = `${title}${isBrandingHidden ? "" : ` | ${APP_NAME}`}`; let seoObject = buildSeoMeta({ title: pageTitle, image,