fix: check for isEmbed (#12907)
* fix: check for isEmbed * chore: useIsEmbed hook * Update packages/features/bookings/Booker/components/Header.tsx Co-authored-by: Peer Richelsen <peeroke@gmail.com> --------- Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
co-authored by
Peer Richelsen
parent
b1bf94aa58
commit
0798e2940a
@@ -4,6 +4,7 @@ import { useCallback, useMemo } from "react";
|
||||
import { shallow } from "zustand/shallow";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { useIsEmbed } from "@calcom/embed-core/embed-iframe";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { BookerLayouts } from "@calcom/prisma/zod-utils";
|
||||
@@ -32,7 +33,7 @@ export function Header({
|
||||
}) {
|
||||
const { t, i18n } = useLocale();
|
||||
const session = useSession();
|
||||
|
||||
const isEmbed = useIsEmbed();
|
||||
const [layout, setLayout] = useBookerStore((state) => [state.layout, state.setLayout], shallow);
|
||||
const selectedDateString = useBookerStore((state) => state.selectedDate);
|
||||
const setSelectedDate = useBookerStore((state) => state.setSelectedDate);
|
||||
@@ -68,7 +69,7 @@ export function Header({
|
||||
if (isMonthView) {
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
{isMyLink ? (
|
||||
{isMyLink && !isEmbed ? (
|
||||
<Tooltip content={t("troubleshooter_tooltip")} side="bottom">
|
||||
<Button
|
||||
color="primary"
|
||||
@@ -168,7 +169,7 @@ const LayoutToggle = ({
|
||||
layout: string;
|
||||
enabledLayouts?: BookerLayouts[];
|
||||
}) => {
|
||||
const isEmbed = typeof window !== "undefined" && window?.isEmbed?.();
|
||||
const isEmbed = useIsEmbed();
|
||||
|
||||
const { t } = useLocale();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user