|
1 | 1 | "use client"; |
2 | 2 |
|
| 3 | +import * as analytics from "@/analytics/dashboard.client"; |
3 | 4 | import { Button } from "@/components/ui/button"; |
4 | 5 | import { useStore } from "@/lib/reactive"; |
5 | 6 | import { getSDKTheme } from "app/(app)/components/sdk-component-theme"; |
6 | 7 | import { LazyConfigureNetworkModal } from "components/configure-networks/LazyConfigureNetworkModal"; |
7 | 8 | import { CustomChainRenderer } from "components/selects/CustomChainRenderer"; |
8 | 9 | import { mapV4ChainToV5Chain } from "contexts/map-chains"; |
9 | | -import { useTrack } from "hooks/analytics/useTrack"; |
10 | 10 | import { useAllChainsData } from "hooks/chains/allChains"; |
11 | 11 | import { useTheme } from "next-themes"; |
12 | 12 | import Image from "next/image"; |
@@ -156,6 +156,7 @@ export const CustomConnectWallet = (props: { |
156 | 156 | onDisconnect={async () => { |
157 | 157 | try { |
158 | 158 | await doLogout(); |
| 159 | + analytics.reset(); |
159 | 160 | } catch (err) { |
160 | 161 | console.error("Failed to log out", err); |
161 | 162 | } |
@@ -259,18 +260,16 @@ function ConnectWalletWelcomeScreen(props: { |
259 | 260 | </div> |
260 | 261 | </div> |
261 | 262 |
|
262 | | - <TrackedAnchorLink |
| 263 | + <Link |
263 | 264 | className="text-center font-semibold opacity-70 hover:no-underline hover:opacity-100" |
264 | 265 | target="_blank" |
265 | | - category="custom-connect-wallet" |
266 | | - label="new-to-wallets" |
267 | 266 | href="https://blog.thirdweb.com/web3-wallet/" |
268 | 267 | style={{ |
269 | 268 | color: fontColor, |
270 | 269 | }} |
271 | 270 | > |
272 | 271 | New to Wallets? |
273 | | - </TrackedAnchorLink> |
| 272 | + </Link> |
274 | 273 | </div> |
275 | 274 | ); |
276 | 275 | } |
@@ -303,36 +302,3 @@ export function useCustomConnectModal() { |
303 | 302 | [connect, theme], |
304 | 303 | ); |
305 | 304 | } |
306 | | - |
307 | | -/** |
308 | | - * A link component extends the `Link` component and adds tracking. |
309 | | - */ |
310 | | -function TrackedAnchorLink(props: { |
311 | | - category: string; |
312 | | - label?: string; |
313 | | - trackingProps?: Record<string, string>; |
314 | | - href: string; |
315 | | - target?: string; |
316 | | - children: React.ReactNode; |
317 | | - className?: string; |
318 | | - style?: React.CSSProperties; |
319 | | -}) { |
320 | | - const trackEvent = useTrack(); |
321 | | - const { category, label, trackingProps } = props; |
322 | | - |
323 | | - const onClick = useCallback(() => { |
324 | | - trackEvent({ category, action: "click", label, ...trackingProps }); |
325 | | - }, [trackEvent, category, label, trackingProps]); |
326 | | - |
327 | | - return ( |
328 | | - <Link |
329 | | - onClick={onClick} |
330 | | - target={props.target} |
331 | | - href={props.href} |
332 | | - className={props.className} |
333 | | - style={props.style} |
334 | | - > |
335 | | - {props.children} |
336 | | - </Link> |
337 | | - ); |
338 | | -} |
0 commit comments