From b4082032ba3828c99cebbe9b2c5621eb9f440d07 Mon Sep 17 00:00:00 2001 From: ahaapple Date: Sun, 22 Dec 2024 21:30:30 +0800 Subject: [PATCH] Remove featurebase --- frontend/app/[locale]/(search)/layout.tsx | 5 -- frontend/components/featurebase.tsx | 68 ------------------- frontend/components/layout/mobile-footer.tsx | 8 +-- frontend/components/layout/product-footer.tsx | 1 - .../components/layout/simple-site-footer.tsx | 1 - frontend/components/search/action-buttons.tsx | 1 - 6 files changed, 1 insertion(+), 83 deletions(-) delete mode 100644 frontend/components/featurebase.tsx diff --git a/frontend/app/[locale]/(search)/layout.tsx b/frontend/app/[locale]/(search)/layout.tsx index 8593c35a..c7ae78b7 100644 --- a/frontend/app/[locale]/(search)/layout.tsx +++ b/frontend/app/[locale]/(search)/layout.tsx @@ -7,10 +7,6 @@ interface MarketingLayoutProps { children: React.ReactNode; } -const Featurebase = dynamic(() => import('@/components/featurebase'), { - loading: () => <>, -}); - const OneTapComponent = dynamic(() => import('@/components/google-one-tap'), { loading: () => <>, }); @@ -29,7 +25,6 @@ export default async function MarketingLayout({ children }: MarketingLayoutProps
{!user && } - {user && }
diff --git a/frontend/components/featurebase.tsx b/frontend/components/featurebase.tsx deleted file mode 100644 index 1e5c1827..00000000 --- a/frontend/components/featurebase.tsx +++ /dev/null @@ -1,68 +0,0 @@ -'use client'; -import { useEffect } from 'react'; -import Script from 'next/script'; -import { User } from 'next-auth'; - -interface FeaturebaseProps { - user: User; -} - -const Featurebase = ({ user }: FeaturebaseProps) => { - useEffect(() => { - if (!user) { - return; - } - const win = window as any; - - if (typeof win.Featurebase !== 'function') { - win.Featurebase = function () { - // eslint-disable-next-line prefer-rest-params - (win.Featurebase.q = win.Featurebase.q || []).push(arguments); - }; - } - win.Featurebase( - 'identify', - { - organization: 'memfree', - email: user.email, - name: user.name, - id: user.email, - profilePicture: user.image, - }, - (err) => { - if (err) { - console.error(err); - } else { - // console.log("Data sent successfully!"); - } - }, - ); - }, [user]); - - useEffect(() => { - const win = window as any; - - if (typeof win.Featurebase !== 'function') { - win.Featurebase = function () { - // eslint-disable-next-line prefer-rest-params - (win.Featurebase.q = win.Featurebase.q || []).push(arguments); - }; - } - win.Featurebase('initialize_changelog_widget', { - organization: 'memfree', // Replace this with your featurebase organization name - placement: 'top', // Choose between right, left, top, bottom placement (Optional if fullscreenPopup is enabled) - theme: 'light', // Choose between dark or light theme - fullscreenPopup: true, // Optional - Open a fullscreen announcement of the new feature to the user - locale: 'en', - }); - }, []); - - return ( - <> -