Skip to content

Commit 50192f2

Browse files
committed
posthog migration: part 3
1 parent 5924b03 commit 50192f2

File tree

73 files changed

+233
-718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+233
-718
lines changed

apps/dashboard/src/@/components/blocks/Sidebar.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ export type SidebarBaseLink = {
99
label: React.ReactNode;
1010
exactMatch?: boolean;
1111
icon?: React.FC<{ className?: string }>;
12-
tracking?: {
13-
category: string;
14-
action: string;
15-
label: string;
16-
};
1712
};
1813

1914
export type SidebarLink =

apps/dashboard/src/@/components/blocks/SidebarLayout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ function RenderSidebarGroup(props: {
123123
className="flex items-center gap-2 text-muted-foreground text-sm hover:bg-accent"
124124
activeClassName="text-foreground bg-accent"
125125
exactMatch={link.exactMatch}
126-
tracking={link.tracking}
127126
onClick={() => {
128127
sidebar.setOpenMobile(false);
129128
}}

apps/dashboard/src/@/components/blocks/UpsellBannerCard.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client";
22

33
import { Button } from "@/components/ui/button";
4-
import { TrackedLinkTW } from "@/components/ui/tracked-link";
54
import { cn } from "@/lib/utils";
5+
import Link from "next/link";
66
import type React from "react";
77

88
const ACCENT = {
@@ -103,15 +103,10 @@ export function UpsellBannerCard(props: UpsellBannerCardProps) {
103103
color.btn,
104104
)}
105105
>
106-
<TrackedLinkTW
107-
href={props.cta.link}
108-
category={props.trackingCategory}
109-
label={props.trackingLabel}
110-
target={props.cta.target}
111-
>
106+
<Link href={props.cta.link} target={props.cta.target}>
112107
{props.cta.text}
113108
{props.cta.icon && <span className="ml-2">{props.cta.icon}</span>}
114-
</TrackedLinkTW>
109+
</Link>
115110
</Button>
116111
</div>
117112
</div>

apps/dashboard/src/@/components/ui/NavLink.tsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { cn } from "@/lib/utils";
4-
import { useTrack } from "hooks/analytics/useTrack";
4+
55
import Link from "next/link";
66
import { usePathname } from "next/navigation";
77

@@ -10,16 +10,10 @@ export type NavButtonProps = {
1010
activeClassName?: string;
1111
href: string;
1212
exactMatch?: boolean;
13-
tracking?: {
14-
category: string;
15-
action: string;
16-
label: string;
17-
};
1813
onClick?: () => void;
1914
};
2015

2116
export function NavLink(props: React.PropsWithChildren<NavButtonProps>) {
22-
const track = useTrack();
2317
const pathname = usePathname();
2418
const isActive = pathname
2519
? props.exactMatch
@@ -32,17 +26,7 @@ export function NavLink(props: React.PropsWithChildren<NavButtonProps>) {
3226
className={cn(props.className, isActive && props.activeClassName)}
3327
target={props.href.startsWith("http") ? "_blank" : undefined}
3428
prefetch={false}
35-
onClick={() => {
36-
props.onClick?.();
37-
if (props.tracking) {
38-
track({
39-
category: props.tracking.category,
40-
action: props.tracking.action,
41-
label: props.tracking.label,
42-
url: props.href,
43-
});
44-
}
45-
}}
29+
onClick={props.onClick}
4630
>
4731
{props.children}
4832
</Link>

apps/dashboard/src/@/components/ui/tracked-link.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_components/NFTCards.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SkeletonContainer } from "@/components/ui/skeleton";
2-
import { TrackedLinkTW } from "@/components/ui/tracked-link";
2+
import Link from "next/link";
33
import { useMemo } from "react";
44
import { type NFT, type ThirdwebClient, ZERO_ADDRESS } from "thirdweb";
55
import { NFTMediaWithEmptyState } from "tw-components/nft-media";
@@ -28,7 +28,6 @@ const dummyMetadata: (idx: number) => NFTWithContract = (idx) => ({
2828

2929
interface NFTCardsProps {
3030
nfts: Array<NFTWithContract>;
31-
trackingCategory: string;
3231
isPending: boolean;
3332
allNfts?: boolean;
3433
projectMeta: ProjectMeta | undefined;
@@ -37,7 +36,6 @@ interface NFTCardsProps {
3736

3837
export const NFTCards: React.FC<NFTCardsProps> = ({
3938
nfts,
40-
trackingCategory,
4139
isPending,
4240
allNfts,
4341
projectMeta,
@@ -91,9 +89,7 @@ export const NFTCards: React.FC<NFTCardsProps> = ({
9189
render={(v) => {
9290
return (
9391
<h2 className="font-semibold tracking-tight">
94-
<TrackedLinkTW
95-
category={trackingCategory}
96-
label="view_nft"
92+
<Link
9793
href={buildContractPagePath({
9894
projectMeta,
9995
chainIdOrSlug: token.chainId.toString(),
@@ -103,7 +99,7 @@ export const NFTCards: React.FC<NFTCardsProps> = ({
10399
className="before:absolute before:inset-0"
104100
>
105101
{v.name}
106-
</TrackedLinkTW>
102+
</Link>
107103
</h2>
108104
);
109105
}}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/account/components/nfts-owned.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const NftsOwned: React.FC<NftsOwnedProps> = ({
4242
}))}
4343
allNfts
4444
isPending={isWalletNFTsLoading}
45-
trackingCategory="account_nfts_owned"
4645
/>
4746
) : isWalletNFTsLoading ? null : error ? (
4847
<p>Failed to fetch NFTs for this account: {error}</p>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/AccountsPage.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { ButtonGroup, Flex } from "@chakra-ui/react";
44
import type { ThirdwebContract } from "thirdweb";
5-
import { Heading, TrackedLinkButton } from "tw-components";
5+
import { Heading, LinkButton } from "tw-components";
66
import type { ProjectMeta } from "../../../../../team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/types";
77
import { AccountsCount } from "./components/accounts-count";
88
import { AccountsTable } from "./components/accounts-table";
@@ -33,15 +33,13 @@ export const AccountsPage: React.FC<AccountsPageProps> = ({
3333
gap={2}
3434
w="inherit"
3535
>
36-
<TrackedLinkButton
37-
category="smart-wallet"
36+
<LinkButton
3837
variant="solid"
39-
label="docs-factory-page"
4038
href="https://portal.thirdweb.com/wallets/smart-wallet/get-started#3-connect-smart-wallets-in-your-application"
4139
isExternal
4240
>
4341
View Documentation
44-
</TrackedLinkButton>
42+
</LinkButton>
4543
<CreateAccountButton contract={contract} isLoggedIn={isLoggedIn} />
4644
</ButtonGroup>
4745
</Flex>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useMemo, useState } from "react";
1515
import type { ThirdwebContract } from "thirdweb";
1616
import { getAccounts, totalAccounts } from "thirdweb/extensions/erc4337";
1717
import { useReadContract } from "thirdweb/react";
18-
import { Text, TrackedCopyButton } from "tw-components";
18+
import { Legacy_CopyButton, Text } from "tw-components";
1919
import type { ProjectMeta } from "../../../../../../team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/types";
2020
import { buildContractPagePath } from "../../_utils/contract-page-path";
2121

@@ -27,9 +27,8 @@ const columns = [
2727
cell: (info) => (
2828
<Flex gap={2} align="center">
2929
<Text fontFamily="mono">{info.getValue()}</Text>
30-
<TrackedCopyButton
30+
<Legacy_CopyButton
3131
value={info.getValue()}
32-
category="accounts"
3332
aria-label="Copy account address"
3433
colorScheme="primary"
3534
/>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/ContractOverviewPage.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ interface ContractOverviewPageProps {
2626
projectMeta: ProjectMeta | undefined;
2727
}
2828

29-
const TRACKING_CATEGORY = "contract_overview";
30-
3129
export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
3230
contract,
3331
isErc1155,
@@ -75,7 +73,6 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
7573
<ContractAnalyticsOverviewCard
7674
contractAddress={contract.address}
7775
chainId={contract.chain.id}
78-
trackingCategory={TRACKING_CATEGORY}
7976
chainSlug={chainSlug}
8077
projectMeta={projectMeta}
8178
/>
@@ -85,7 +82,6 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
8582
<MarketplaceDetails
8683
contract={contract}
8784
projectMeta={projectMeta}
88-
trackingCategory={TRACKING_CATEGORY}
8985
hasEnglishAuctions={hasEnglishAuctions}
9086
hasDirectListings={hasDirectListings}
9187
chainSlug={chainSlug}
@@ -95,7 +91,6 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
9591
{(isErc1155 || isErc721) && (
9692
<NFTDetails
9793
contract={contract}
98-
trackingCategory={TRACKING_CATEGORY}
9994
isErc721={isErc721}
10095
chainSlug={chainSlug}
10196
projectMeta={projectMeta}
@@ -106,22 +101,19 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
106101

107102
<LatestEvents
108103
contract={contract}
109-
trackingCategory={TRACKING_CATEGORY}
110104
chainSlug={chainSlug}
111105
projectMeta={projectMeta}
112106
/>
113107

114108
{isPermissionsEnumerable && (
115109
<PermissionsTable
116110
contract={contract}
117-
trackingCategory={TRACKING_CATEGORY}
118111
chainSlug={chainSlug}
119112
projectMeta={projectMeta}
120113
/>
121114
)}
122115

123116
<BuildYourApp
124-
trackingCategory={TRACKING_CATEGORY}
125117
chainSlug={chainSlug}
126118
contractAddress={contract.address}
127119
projectMeta={projectMeta}

0 commit comments

Comments
 (0)