From e15531c0449915bd7a87c56355cd08d91009d1bd Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Mon, 5 Feb 2024 13:28:24 +0530 Subject: [PATCH] fix: build fixes --- web/components/license/pro-plan-modal.tsx | 11 +++++------ web/components/workspace/help-section.tsx | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/web/components/license/pro-plan-modal.tsx b/web/components/license/pro-plan-modal.tsx index f67fc825ea..3acffa7504 100644 --- a/web/components/license/pro-plan-modal.tsx +++ b/web/components/license/pro-plan-modal.tsx @@ -1,7 +1,8 @@ import { FC, Fragment, useState } from "react"; import { Dialog, Transition, Tab } from "@headlessui/react"; import { CheckCircle } from "lucide-react"; -import { useApplication } from "hooks/store"; +// store +import { useEventTracker } from "hooks/store"; function classNames(...classes: any[]) { return classes.filter(Boolean).join(" "); @@ -35,9 +36,7 @@ export type ProPlanModalProps = { export const ProPlanModal: FC = (props) => { const { isOpen, handleClose } = props; // store - const { - eventTracker: { captureEvent }, - } = useApplication(); + const { captureEvent } = useEventTracker(); // states // eslint-disable-next-line @typescript-eslint/no-unused-vars const [tabIndex, setTabIndex] = useState(0); @@ -45,14 +44,14 @@ export const ProPlanModal: FC = (props) => { const handleProPlaneMonthRedirection = () => { if (process.env.NEXT_PUBLIC_PRO_PLAN_MONTHLY_REDIRECT_URL) { window.open(process.env.NEXT_PUBLIC_PRO_PLAN_MONTHLY_REDIRECT_URL, "_blank"); - captureEvent("pro_plan_modal_month_redirection"); + captureEvent("pro_plan_modal_month_redirection", {}); } }; const handleProPlanYearlyRedirection = () => { if (process.env.NEXT_PUBLIC_PRO_PLAN_YEARLY_REDIRECT_URL) { window.open(process.env.NEXT_PUBLIC_PRO_PLAN_YEARLY_REDIRECT_URL, "_blank"); - captureEvent("pro_plan_modal_yearly_redirection"); + captureEvent("pro_plan_modal_yearly_redirection", {}); } }; diff --git a/web/components/workspace/help-section.tsx b/web/components/workspace/help-section.tsx index be92c5cdba..8e8236cc84 100644 --- a/web/components/workspace/help-section.tsx +++ b/web/components/workspace/help-section.tsx @@ -3,7 +3,7 @@ import Link from "next/link"; import { Transition } from "@headlessui/react"; import { observer } from "mobx-react-lite"; // hooks -import { useApplication } from "hooks/store"; +import { useApplication, useEventTracker } from "hooks/store"; import useOutsideClickDetector from "hooks/use-outside-click-detector"; // icons import { FileText, HelpCircle, MessagesSquare, MoveLeft, Zap } from "lucide-react"; @@ -48,8 +48,8 @@ export const WorkspaceHelpSection: React.FC = observe const { theme: { sidebarCollapsed, toggleSidebar }, commandPalette: { toggleShortcutModal }, - eventTracker: { captureEvent }, } = useApplication(); + const { captureEvent } = useEventTracker(); // states const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); // refs @@ -61,7 +61,7 @@ export const WorkspaceHelpSection: React.FC = observe const handleProPlanModalOpen = () => { setIsProPlanModalOpen(true); - captureEvent("pro_plan_modal_opened"); + captureEvent("pro_plan_modal_opened", {}); }; return (