From 39935306fc758837dd7344706b31088b9ab98d78 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Thu, 14 Apr 2022 08:17:34 +0530 Subject: [PATCH] Embed behind authentication page, Floating Button Popup and other changes (#2468) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Omar López --- apps/web/components/Shell.tsx | 12 +- .../booking/pages/AvailabilityPage.tsx | 15 +- .../components/booking/pages/BookingPage.tsx | 12 +- apps/web/lib/app-providers.tsx | 6 +- apps/web/lib/telemetry.ts | 3 +- apps/web/pages/[user].tsx | 8 + apps/web/pages/team/[slug].tsx | 16 +- packages/embeds/embed-core/README.md | 39 ++-- packages/embeds/embed-core/index.html | 34 ++- .../playwright/tests/action-based.test.ts | 6 + .../embeds/embed-core/src/FloatingButton.ts | 33 +++ packages/embeds/embed-core/src/ModalBox.ts | 124 +++-------- .../embeds/embed-core/src/embed-iframe.ts | 29 ++- packages/embeds/embed-core/src/embed.css | 2 +- packages/embeds/embed-core/src/embed.ts | 63 +++++- packages/embeds/embed-core/src/inline.ts | 27 +++ packages/embeds/embed-core/src/loader.css | 62 ++++++ packages/embeds/embed-core/src/tailwind.css | 203 ++++++++++++++++++ packages/embeds/embed-react/src/Cal.tsx | 16 +- packages/embeds/embed-react/test-cal.tsx | 1 + 20 files changed, 559 insertions(+), 152 deletions(-) create mode 100644 packages/embeds/embed-core/src/FloatingButton.ts create mode 100644 packages/embeds/embed-core/src/inline.ts create mode 100644 packages/embeds/embed-core/src/loader.css create mode 100644 packages/embeds/embed-core/src/tailwind.css diff --git a/apps/web/components/Shell.tsx b/apps/web/components/Shell.tsx index 12dd4ea822..15efb679e1 100644 --- a/apps/web/components/Shell.tsx +++ b/apps/web/components/Shell.tsx @@ -17,6 +17,7 @@ import { useRouter } from "next/router"; import React, { Fragment, ReactNode, useEffect } from "react"; import { Toaster } from "react-hot-toast"; +import { useIsEmbed } from "@calcom/embed-core"; import Button from "@calcom/ui/Button"; import Dropdown, { DropdownMenuContent, @@ -135,6 +136,7 @@ export default function Shell(props: { flexChildrenContainer?: boolean; isPublic?: boolean; }) { + const isEmbed = useIsEmbed(); const { t } = useLocale(); const router = useRouter(); const { loading, session } = useRedirectToLoginIfUnauthenticated(props.isPublic); @@ -231,7 +233,7 @@ export default function Shell(props: { className={classNames("flex h-screen overflow-hidden", props.large ? "bg-white" : "bg-gray-100")} data-testid="dashboard-shell"> {status === "authenticated" && ( -
+
@@ -322,7 +324,9 @@ export default function Shell(props: { )}> {/* show top navigation for md and smaller (tablet and phones) */} {status === "authenticated" && ( -
{/* show bottom navigation for md and smaller (tablet and phones) */} {status === "authenticated" && ( -