Adds banner to Opt-in to V2 UI (#4187)
This commit is contained in:
1 parent
49a379ec6c
commit
8653e8eea5
3 files changed
+57
-3
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { Alert } from "@calcom/ui/Alert";
|
||||
import { Alert as AlertV2 } from "@calcom/ui/v2/core/Alert";
|
||||
|
||||
function UserV2OptInBanner() {
|
||||
// Only show on client-side
|
||||
if (typeof document === "undefined") return null;
|
||||
|
||||
const hasV2OptInCookie = document.cookie.includes("calcom-v2-early-access=1");
|
||||
|
||||
if (hasV2OptInCookie)
|
||||
return (
|
||||
<AlertV2
|
||||
severity="info"
|
||||
title={
|
||||
<>
|
||||
You're using the new version of Cal.com.{" "}
|
||||
<a href="/api/v2-opt-in" className="underline">
|
||||
Go back to previous version
|
||||
</a>
|
||||
.
|
||||
</>
|
||||
}
|
||||
className="mb-2"
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<Alert
|
||||
severity="info"
|
||||
title={
|
||||
<>
|
||||
Want to try the new version of Cal.com?{" "}
|
||||
<a href="/api/v2-opt-in" className="underline">
|
||||
Opt-in to our V2 beta
|
||||
</a>
|
||||
.
|
||||
</>
|
||||
}
|
||||
className="mb-2"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default UserV2OptInBanner;
|
||||
@@ -11,6 +11,7 @@ import LicenseBanner from "@calcom/features/ee/common/components/LicenseBanner";
|
||||
import TrialBanner from "@calcom/features/ee/common/components/TrialBanner";
|
||||
import ImpersonatingBanner from "@calcom/features/ee/impersonation/components/ImpersonatingBanner";
|
||||
import HelpMenuItem from "@calcom/features/ee/support/components/HelpMenuItem";
|
||||
import UserV2OptInBanner from "@calcom/features/users/components/UserV2OptInBanner";
|
||||
import CustomBranding from "@calcom/lib/CustomBranding";
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { JOIN_SLACK, ROADMAP, WEBAPP_URL } from "@calcom/lib/constants";
|
||||
@@ -137,6 +138,7 @@ const Layout = (props: LayoutProps) => {
|
||||
<div className="flex h-screen overflow-hidden" data-testid="dashboard-shell">
|
||||
{props.SidebarContainer || <SideBarContainer />}
|
||||
<div className="flex w-0 flex-1 flex-col overflow-hidden">
|
||||
<UserV2OptInBanner />
|
||||
<ImpersonatingBanner />
|
||||
<MainContainer {...props} />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user