diff --git a/apps/web/src/components/Basenames/RegistrationFlow.tsx b/apps/web/src/components/Basenames/RegistrationFlow.tsx index 0ac5a13e8b..6954b9fd03 100644 --- a/apps/web/src/components/Basenames/RegistrationFlow.tsx +++ b/apps/web/src/components/Basenames/RegistrationFlow.tsx @@ -2,7 +2,6 @@ import dynamic from 'next/dynamic'; import { useLocalStorage } from 'usehooks-ts'; import { Transition } from '@headlessui/react'; -import { useAnalytics } from 'apps/web/contexts/Analytics'; import RegistrationBackground from 'apps/web/src/components/Basenames/RegistrationBackground'; import RegistrationBrand from 'apps/web/src/components/Basenames/RegistrationBrand'; import { @@ -24,7 +23,6 @@ import { USERNAME_DOMAINS, } from 'apps/web/src/utils/usernames'; import classNames from 'classnames'; -import { ActionType } from 'libs/base-ui/utils/logEvent'; import { useSearchParams } from 'next/navigation'; import { useCallback, useEffect, useMemo } from 'react'; import { useAccount, useSwitchChain } from 'wagmi'; @@ -44,7 +42,6 @@ export const claimQueryKey = 'claim'; export function RegistrationFlow() { const { chain } = useAccount(); - const { logEventWithContext } = useAnalytics(); const searchParams = useSearchParams(); const [, setIsModalOpen] = useLocalStorage('BasenamesLaunchModalVisible', true); const [, setIsBannerVisible] = useLocalStorage('basenamesLaunchBannerVisible', true); @@ -110,10 +107,6 @@ export function RegistrationFlow() { setRegistrationStep(RegistrationSteps.Search); }, [setRegistrationStep]); - useEffect(() => { - logEventWithContext('initial_render', ActionType.render); - }, [logEventWithContext]); - useEffect(() => { const claimQuery = searchParams?.get(claimQueryKey); if (claimQuery) { diff --git a/apps/web/src/components/Basenames/RegistrationSearchInput/index.tsx b/apps/web/src/components/Basenames/RegistrationSearchInput/index.tsx index 4c19d50dbb..ab12bef9eb 100644 --- a/apps/web/src/components/Basenames/RegistrationSearchInput/index.tsx +++ b/apps/web/src/components/Basenames/RegistrationSearchInput/index.tsx @@ -241,11 +241,17 @@ export default function RegistrationSearchInput({ }, [resetBackground, setSearchInputFocused]); useEffect(() => { - if (!invalidWithMessage) return; - - // Log invalid - logEventWithContext('search_available_name_invalid', ActionType.error, { error: message }); - }, [invalidWithMessage, logEventWithContext, message, setSearchInputFocused]); + if (debouncedSearch.length > 2 && invalidWithMessage) { + // Log invalid + logEventWithContext('search_available_name_invalid', ActionType.error, { error: message }); + } + }, [ + debouncedSearch.length, + invalidWithMessage, + logEventWithContext, + message, + setSearchInputFocused, + ]); const selectName = useCallback(() => { handleSelectName(debouncedSearch); diff --git a/apps/web/src/components/Basenames/UsernameProfile/index.tsx b/apps/web/src/components/Basenames/UsernameProfile/index.tsx index 4d275eab6a..b96ac34cad 100644 --- a/apps/web/src/components/Basenames/UsernameProfile/index.tsx +++ b/apps/web/src/components/Basenames/UsernameProfile/index.tsx @@ -2,19 +2,13 @@ import UsernameProfileContent from 'apps/web/src/components/Basenames/UsernameProfileContent'; import UsernameProfileSidebar from 'apps/web/src/components/Basenames/UsernameProfileSidebar'; -import { useAnalytics } from 'apps/web/contexts/Analytics'; -import { ActionType } from 'libs/base-ui/utils/logEvent'; import UsernameProfileSettings from 'apps/web/src/components/Basenames/UsernameProfileSettings'; import { useUsernameProfile } from 'apps/web/src/components/Basenames/UsernameProfileContext'; import UsernameProfileSettingsProvider from 'apps/web/src/components/Basenames/UsernameProfileSettingsContext'; export default function UsernameProfile() { - const { logEventWithContext } = useAnalytics(); - const { showProfileSettings } = useUsernameProfile(); - logEventWithContext('page_loaded', ActionType.render); - if (showProfileSettings) return (