refactor: remove cal ai banners (#24885)
This commit is contained in:
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 87 KiB |
@@ -836,8 +836,6 @@
|
||||
"workflow_validation_failed": "Workflow validation failed",
|
||||
"workflow_validation_empty_fields": "One or more workflow steps have empty message content",
|
||||
"workflow_validation_unverified_contacts": "One or more phone numbers or email addresses are not verified",
|
||||
"supercharge_your_workflows_with_cal_ai": "Supercharge your Workflows with Cal.ai",
|
||||
"supercharge_your_workflows_with_cal_ai_description": "Lifelike AI agents that book meetings, send reminders, and follow up with your customers.",
|
||||
"phone_number_imported_successfully": "Phone number imported and linked to agent successfully",
|
||||
"phone_number_deleted_successfully": "Phone number deleted successfully",
|
||||
"delete_phone_number_confirmation": "Are you sure you want to delete this phone number? This action cannot be undone.",
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { localStorage } from "@calcom/lib/webstorage";
|
||||
import { Icon } from "@calcom/ui/components/icon";
|
||||
|
||||
export function CalAiBanner() {
|
||||
const { t } = useLocale();
|
||||
const pathname = usePathname();
|
||||
const [isVisible, setIsVisible] = useState(() => {
|
||||
if (typeof window === "undefined") return true;
|
||||
return !localStorage.getItem("calai-banner-dismissed");
|
||||
});
|
||||
|
||||
const handleDismiss = () => {
|
||||
localStorage.setItem("calai-banner-dismissed", "true");
|
||||
setIsVisible(false);
|
||||
};
|
||||
|
||||
const handleTryNow = () => {
|
||||
window.open("/workflow/new?action=calAi&templateWorkflowId=wf-11", "_blank");
|
||||
};
|
||||
|
||||
if (!isVisible) return null;
|
||||
|
||||
if (!(pathname === "/workflows" || pathname === "/event-types" || pathname === "/bookings/upcoming"))
|
||||
return null;
|
||||
|
||||
return (
|
||||
<div className="bg-launch-dark relative mb-6 w-full overflow-hidden rounded-lg text-white">
|
||||
<button
|
||||
onClick={handleDismiss}
|
||||
className="absolute right-2 top-2 z-10 rounded-[10px] p-2"
|
||||
aria-label="Close banner">
|
||||
<Icon name="x" className="h-4 w-4 text-white" />
|
||||
</button>
|
||||
|
||||
<div className="flex flex-col md:flex-row">
|
||||
<div className="flex-1 p-6 pr-6 lg:p-8">
|
||||
<h2 className="font-cal font-subtle text-lg">{t("supercharge_your_workflows_with_cal_ai")}</h2>
|
||||
<p className="text-subtle mb-4 text-sm">
|
||||
{t("supercharge_your_workflows_with_cal_ai_description")}
|
||||
</p>
|
||||
|
||||
<button
|
||||
onClick={handleTryNow}
|
||||
className="rounded-[10px] bg-gradient-to-b from-[#6349EA] to-[#875FE0] px-5 py-2 text-sm font-medium text-white hover:from-[#5A42D1] hover:to-[#7B6FD7]">
|
||||
{t("try_now")}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<img src="/cal-ai-banner.svg" alt="Cal.ai Banner" className="mt-auto hidden h-40 md:block" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useSession } from "next-auth/react";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import { useRouter } from "next/navigation";
|
||||
import type { Dispatch, ReactElement, ReactNode, SetStateAction } from "react";
|
||||
import React, { cloneElement } from "react";
|
||||
import { Toaster } from "sonner";
|
||||
@@ -17,7 +17,6 @@ import { Button } from "@calcom/ui/components/button";
|
||||
import { ErrorBoundary } from "@calcom/ui/components/errorBoundary";
|
||||
import { SkeletonText } from "@calcom/ui/components/skeleton";
|
||||
|
||||
import { CalAiBanner } from "./CalAiBanner";
|
||||
import { DynamicModals } from "./DynamicModals";
|
||||
import { SideBarContainer } from "./SideBar";
|
||||
import { TopNavContainer } from "./TopNav";
|
||||
@@ -28,7 +27,6 @@ import { useAppTheme } from "./useAppTheme";
|
||||
|
||||
const Layout = (props: LayoutProps) => {
|
||||
const { banners, bannersHeight } = useBanners();
|
||||
const pathname = usePathname();
|
||||
|
||||
useFormbricks();
|
||||
|
||||
@@ -208,7 +206,6 @@ function MainContainer({
|
||||
{/* show top navigation for md and smaller (tablet and phones) */}
|
||||
{TopNavContainerProp}
|
||||
<div className="max-w-full p-2 sm:py-4 lg:px-6">
|
||||
<CalAiBanner />
|
||||
<ErrorBoundary>
|
||||
{!props.withoutMain ? <ShellMain {...props}>{props.children}</ShellMain> : props.children}
|
||||
</ErrorBoundary>
|
||||
|
||||
Reference in New Issue
Block a user