The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
remove welcomeFlow attr
Steven Tey8a7fee334351
diff --git a/components/app/modals/add-edit-link-modal/index.tsx b/components/app/modals/add-edit-link-modal/index.tsxindex 21aa6eb967..38cc7f7308 100644--- a/components/app/modals/add-edit-link-modal/index.tsx+++ b/components/app/modals/add-edit-link-modal/index.tsx@@ -49,14 +49,12 @@ function AddEditLinkModal({props,duplicateProps,homepageDemo,- welcomeFlow,}: {showAddEditLinkModal: boolean;setShowAddEditLinkModal: Dispatch<SetStateAction<boolean>>;props?: LinkProps;duplicateProps?: LinkProps;homepageDemo?: boolean;- welcomeFlow?: boolean;}) {const router = useRouter();const { slug } = router.query as { slug: string };@@ -260,6 +258,10 @@ function AddEditLinkModal({const [lockKey, setLockKey] = useState(true);+ const welcomeFlow = useMemo(() => {+ return router.asPath.split("?")[0] === "/welcome";+ }, [router.asPath]);+return (<ModalshowModal={showAddEditLinkModal}@@ -670,12 +672,10 @@ export function useAddEditLinkModal({props,duplicateProps,homepageDemo,- welcomeFlow,}: {props?: LinkProps;duplicateProps?: LinkProps;homepageDemo?: boolean;- welcomeFlow?: boolean;} = {}) {const [showAddEditLinkModal, setShowAddEditLinkModal] = useState(false);@@ -687,7 +687,6 @@ export function useAddEditLinkModal({props={props}duplicateProps={duplicateProps}homepageDemo={homepageDemo}- welcomeFlow={welcomeFlow}/>);}, [showAddEditLinkModal, setShowAddEditLinkModal]);diff --git a/components/app/modals/upgrade-plan-modal.tsx b/components/app/modals/upgrade-plan-modal.tsxindex 89278c5700..d05c2caf97 100644--- a/components/app/modals/upgrade-plan-modal.tsx+++ b/components/app/modals/upgrade-plan-modal.tsx@@ -21,11 +21,9 @@ import Confetti from "react-dom-confetti";function UpgradePlanModal({showUpgradePlanModal,setShowUpgradePlanModal,- welcomeFlow,}: {showUpgradePlanModal: boolean;setShowUpgradePlanModal: Dispatch<SetStateAction<boolean>>;- welcomeFlow?: boolean;}) {const router = useRouter();const { slug } = router.query;@@ -45,6 +43,11 @@ function UpgradePlanModal({];}, [plan]);const [clicked, setClicked] = useState(false);++ const welcomeFlow = useMemo(() => {+ return router.asPath.split("?")[0] === "/welcome";+ }, [router.asPath]);+return (<ModalshowModal={showUpgradePlanModal}@@ -209,9 +212,7 @@ function UpgradePlanModal({);}-export function useUpgradePlanModal({- welcomeFlow,-}: { welcomeFlow?: boolean } = {}) {+export function useUpgradePlanModal() {const [showUpgradePlanModal, setShowUpgradePlanModal] = useState(false);const UpgradePlanModalCallback = useCallback(() => {@@ -219,10 +220,9 @@ export function useUpgradePlanModal({<UpgradePlanModalshowUpgradePlanModal={showUpgradePlanModal}setShowUpgradePlanModal={setShowUpgradePlanModal}- welcomeFlow={welcomeFlow}/>);- }, [showUpgradePlanModal, setShowUpgradePlanModal, welcomeFlow]);+ }, [showUpgradePlanModal, setShowUpgradePlanModal]);return useMemo(() => ({diff --git a/pages/app/welcome.tsx b/pages/app/welcome.tsxindex 7d8478a47c..423c4fd583 100644--- a/pages/app/welcome.tsx+++ b/pages/app/welcome.tsx@@ -12,15 +12,9 @@ import { ArrowLeft } from "lucide-react";import { useUpgradePlanModal } from "@/components/app/modals/upgrade-plan-modal";export default function Welcome() {- const { setShowAddProjectModal, AddProjectModal } = useAddProjectModal({- welcomeFlow: true,- });- const { setShowAddEditLinkModal, AddEditLinkModal } = useAddEditLinkModal({- welcomeFlow: true,- });- const { setShowUpgradePlanModal, UpgradePlanModal } = useUpgradePlanModal({- welcomeFlow: true,- });+ const { setShowAddProjectModal, AddProjectModal } = useAddProjectModal();+ const { setShowAddEditLinkModal, AddEditLinkModal } = useAddEditLinkModal();+ const { setShowUpgradePlanModal, UpgradePlanModal } = useUpgradePlanModal();const router = useRouter();