diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index 9ed76360b4..dbfa63657e 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -36,7 +36,7 @@ import type { AvailabilityPageProps } from "../../../pages/[user]/[type]"; import type { DynamicAvailabilityPageProps } from "../../../pages/d/[link]/[slug]"; import type { AvailabilityTeamPageProps } from "../../../pages/team/[slug]/[type]"; -const PoweredByCal = dynamic(() => import("@components/ui/PoweredByCal")); +const PoweredBy = dynamic(() => import("@calcom/ee/components/PoweredBy")); const Toaster = dynamic(() => import("react-hot-toast").then((mod) => mod.Toaster), { ssr: false }); /*const SlotPicker = dynamic(() => import("../SlotPicker").then((mod) => mod.SlotPicker), { @@ -301,7 +301,7 @@ const AvailabilityPage = ({ profile, eventType, ...restProps }: Props) => { {/* FIXME: We don't show branding in Embed yet because we need to place branding on top of the main content. Keeping it outside the main content would have visibility issues because outside main content background is transparent */} - {!restProps.isBrandingHidden && !isEmbed && } + {!restProps.isBrandingHidden && !isEmbed && } diff --git a/apps/web/components/ui/PoweredByCal.tsx b/apps/web/components/ui/PoweredByCal.tsx deleted file mode 100644 index 3825fc11f4..0000000000 --- a/apps/web/components/ui/PoweredByCal.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import Link from "next/link"; - -import { useIsEmbed } from "@calcom/embed-core/embed-iframe"; -import { POWERED_BY_URL } from "@calcom/lib/constants"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; - -const PoweredByCal = () => { - const { t } = useLocale(); - const isEmbed = useIsEmbed(); - return ( -
- - {t("powered_by")}{" "} - Cal.com Logo - Cal.com Logo - -
- ); -}; - -export default PoweredByCal; diff --git a/packages/features/ee/components/PoweredBy.tsx b/packages/features/ee/components/PoweredBy.tsx new file mode 100644 index 0000000000..6927a7baa2 --- /dev/null +++ b/packages/features/ee/components/PoweredBy.tsx @@ -0,0 +1,39 @@ +import { useSession } from "next-auth/react"; +import Link from "next/link"; + +import { useIsEmbed } from "@calcom/embed-core/embed-iframe"; +import { APP_NAME, POWERED_BY_URL } from "@calcom/lib/constants"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; + +const PoweredByCal = () => { + const { t } = useLocale(); + const session = useSession(); + const isEmbed = useIsEmbed(); + const hasValidLicense = session.data ? session.data.hasValidLicense : null; + + return ( +
+ + {t("powered_by")}{" "} + {APP_NAME === "Cal.com" || !hasValidLicense ? ( + <> + Cal.com Logo + Cal.com Logo + + ) : ( + {APP_NAME} + )} + +
+ ); +}; + +export default PoweredByCal;