From f6930df87d1bdef32297af2834741e801f6ead7f Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Thu, 6 Jun 2024 18:55:32 +0200 Subject: [PATCH] chore: removed next app dir banner (#15356) * removed next app dir banner * yarn lock --- packages/features/shell/Shell.tsx | 2 - .../users/components/UserV2OptInBanner.tsx | 49 ------------------- 2 files changed, 51 deletions(-) delete mode 100644 packages/features/users/components/UserV2OptInBanner.tsx diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx index ecf979a272..8361ccde74 100644 --- a/packages/features/shell/Shell.tsx +++ b/packages/features/shell/Shell.tsx @@ -34,7 +34,6 @@ import { InvalidAppCredentialBanners, type InvalidAppCredentialBannersProps, } from "@calcom/features/users/components/InvalidAppCredentialsBanner"; -import UserV2OptInBanner from "@calcom/features/users/components/UserV2OptInBanner"; import VerifyEmailBanner, { type VerifyEmailBannerProps, } from "@calcom/features/users/components/VerifyEmailBanner"; @@ -257,7 +256,6 @@ const Layout = (props: LayoutProps) => {
{banners && !props.isPlatformUser && (
- {Object.keys(banners).map((key) => { if (key === "teamUpgradeBanner") { const Banner = BannerComponent[key]; diff --git a/packages/features/users/components/UserV2OptInBanner.tsx b/packages/features/users/components/UserV2OptInBanner.tsx deleted file mode 100644 index f6b9356633..0000000000 --- a/packages/features/users/components/UserV2OptInBanner.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { useSession } from "next-auth/react"; - -import { - APP_NAME, - FUTURE_ROUTES_OVERRIDE_COOKIE_NAME as COOKIE_NAME, - IS_CALCOM, -} from "@calcom/lib/constants"; -import { TopBanner } from "@calcom/ui"; - -/** Repurposing this component so we can opt-in and out from app router */ -function UserV2OptInBanner() { - const session = useSession(); - - // Only show on client-side - if (typeof document === "undefined") return null; - // Only Admins can opt-in for now - if (session.data?.user.role !== "ADMIN") return null; - // Only Cal.com ADMINs can opt-in for now, also show on dev - if (process.env.NODE_ENV === "production" && !IS_CALCOM) return null; - - const hasV2OptInCookie = document.cookie.includes(`${COOKIE_NAME}=1`); - - if (hasV2OptInCookie) - return ( - - Go back - - } - /> - ); - - return ( - - Opt-in to future routes - - } - /> - ); -} - -export default UserV2OptInBanner;