Skip to content

Commit b1e03cb

Browse files
jnsdlsMananTank
authored andcommitted
posthog migration: part 3
1 parent e85d198 commit b1e03cb

File tree

156 files changed

+487
-851
lines changed

Some content is hidden

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

156 files changed

+487
-851
lines changed

apps/dashboard/src/@/components/billing.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export function CheckoutButton(props: {
3939
>
4040
<Link
4141
target="_blank"
42+
rel="noopener noreferrer"
4243
href={buildCheckoutUrl({
4344
teamSlug: props.teamSlug,
4445
sku: props.sku,
@@ -87,7 +88,7 @@ export function BillingPortalButton(props: {
8788
<a
8889
href={buildBillingPortalUrl({ teamSlug: props.teamSlug })}
8990
target="_blank"
90-
rel="noreferrer"
91+
rel="noopener noreferrer"
9192
>
9293
{props.children}
9394
</a>

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: 6 additions & 5 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,16 @@ export function UpsellBannerCard(props: UpsellBannerCardProps) {
103103
color.btn,
104104
)}
105105
>
106-
<TrackedLinkTW
106+
<Link
107107
href={props.cta.link}
108-
category={props.trackingCategory}
109-
label={props.trackingLabel}
110108
target={props.cta.target}
109+
rel={
110+
props.cta.target === "_blank" ? "noopener noreferrer" : undefined
111+
}
111112
>
112113
{props.cta.text}
113114
{props.cta.icon && <span className="ml-2">{props.cta.icon}</span>}
114-
</TrackedLinkTW>
115+
</Link>
115116
</Button>
116117
</div>
117118
</div>

apps/dashboard/src/@/components/blocks/app-footer.tsx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,29 @@ export function AppFooter(props: AppFooterProps) {
7070
</div>
7171
<div className="flex flex-row gap-3">
7272
<Button size="icon" variant="ghost" asChild className="size-9">
73-
<Link href="https://github.com/thirdweb-dev" target="_blank">
73+
<Link
74+
href="https://github.com/thirdweb-dev"
75+
target="_blank"
76+
rel="noopener noreferrer"
77+
>
7478
<GithubIcon className="size-5 text-muted-foreground" />
7579
</Link>
7680
</Button>
7781
<Button size="icon" variant="ghost" asChild className="size-9">
78-
<Link href="https://www.tiktok.com/@thirdweb" target="_blank">
82+
<Link
83+
href="https://www.tiktok.com/@thirdweb"
84+
target="_blank"
85+
rel="noopener noreferrer"
86+
>
7987
<TiktokIcon className="size-5 text-muted-foreground" />
8088
</Link>
8189
</Button>
8290
<Button size="icon" variant="ghost" asChild className="size-9">
83-
<Link href="https://www.instagram.com/thirdweb/" target="_blank">
91+
<Link
92+
href="https://www.instagram.com/thirdweb/"
93+
target="_blank"
94+
rel="noopener noreferrer"
95+
>
8496
<InstagramIcon className="size-5 text-muted-foreground" />
8597
</Link>
8698
</Button>
@@ -93,17 +105,29 @@ export function AppFooter(props: AppFooterProps) {
93105
</Link>
94106
</Button>
95107
<Button size="icon" variant="ghost" asChild className="size-9">
96-
<Link href="https://www.youtube.com/@thirdweb_" target="_blank">
108+
<Link
109+
href="https://www.youtube.com/@thirdweb_"
110+
target="_blank"
111+
rel="noopener noreferrer"
112+
>
97113
<YoutubeIcon className="size-5 text-muted-foreground" />
98114
</Link>
99115
</Button>
100116
<Button size="icon" variant="ghost" asChild className="size-9">
101-
<Link href="https://www.reddit.com/r/thirdweb/" target="_blank">
117+
<Link
118+
href="https://www.reddit.com/r/thirdweb/"
119+
target="_blank"
120+
rel="noopener noreferrer"
121+
>
102122
<RedditIcon className="size-5 text-muted-foreground" />
103123
</Link>
104124
</Button>
105125
<Button size="icon" variant="ghost" asChild className="size-9">
106-
<Link href="https://x.com/thirdweb" target="_blank">
126+
<Link
127+
href="https://x.com/thirdweb"
128+
target="_blank"
129+
rel="noopener noreferrer"
130+
>
107131
<XIcon className="size-5 text-muted-foreground" />
108132
</Link>
109133
</Button>

apps/dashboard/src/@/components/blocks/pricing-card.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ export const PricingCard: React.FC<PricingCardProps> = ({
178178
className={highlighted ? undefined : "bg-background"}
179179
asChild
180180
>
181-
<Link href={cta.href} target="_blank" onClick={handleCTAClick}>
181+
<Link
182+
href={cta.href}
183+
target="_blank"
184+
onClick={handleCTAClick}
185+
rel="noopener noreferrer"
186+
>
182187
{has7DayTrial ? "Start 7 Day Free Trial" : cta.label}
183188
</Link>
184189
</Button>

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/@3rdweb-sdk/react/components/connect-wallet/index.tsx

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { getSDKTheme } from "app/(app)/components/sdk-component-theme";
77
import { LazyConfigureNetworkModal } from "components/configure-networks/LazyConfigureNetworkModal";
88
import { CustomChainRenderer } from "components/selects/CustomChainRenderer";
99
import { mapV4ChainToV5Chain } from "contexts/map-chains";
10-
import { useTrack } from "hooks/analytics/useTrack";
1110
import { useAllChainsData } from "hooks/chains/allChains";
1211
import { useTheme } from "next-themes";
1312
import Image from "next/image";
@@ -261,18 +260,17 @@ function ConnectWalletWelcomeScreen(props: {
261260
</div>
262261
</div>
263262

264-
<TrackedAnchorLink
263+
<Link
265264
className="text-center font-semibold opacity-70 hover:no-underline hover:opacity-100"
266265
target="_blank"
267-
category="custom-connect-wallet"
268-
label="new-to-wallets"
266+
rel="noopener noreferrer"
269267
href="https://blog.thirdweb.com/web3-wallet/"
270268
style={{
271269
color: fontColor,
272270
}}
273271
>
274272
New to Wallets?
275-
</TrackedAnchorLink>
273+
</Link>
276274
</div>
277275
);
278276
}
@@ -305,36 +303,3 @@ export function useCustomConnectModal() {
305303
[connect, theme],
306304
);
307305
}
308-
309-
/**
310-
* A link component extends the `Link` component and adds tracking.
311-
*/
312-
function TrackedAnchorLink(props: {
313-
category: string;
314-
label?: string;
315-
trackingProps?: Record<string, string>;
316-
href: string;
317-
target?: string;
318-
children: React.ReactNode;
319-
className?: string;
320-
style?: React.CSSProperties;
321-
}) {
322-
const trackEvent = useTrack();
323-
const { category, label, trackingProps } = props;
324-
325-
const onClick = useCallback(() => {
326-
trackEvent({ category, action: "click", label, ...trackingProps });
327-
}, [trackEvent, category, label, trackingProps]);
328-
329-
return (
330-
<Link
331-
onClick={onClick}
332-
target={props.target}
333-
href={props.href}
334-
className={props.className}
335-
style={props.style}
336-
>
337-
{props.children}
338-
</Link>
339-
);
340-
}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/NextSteps.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
"use client";
2-
import { useTrack } from "hooks/analytics/useTrack";
32
import { FileTextIcon } from "lucide-react";
43
import Link from "next/link";
54
import type { ChainMetadata } from "thirdweb/chains";
65
import { SectionTitle } from "../server/SectionTitle";
76

87
export default function NextSteps(props: { chain: ChainMetadata }) {
98
const { chain } = props;
10-
const trackEvent = useTrack();
119

1210
return (
1311
<section>
@@ -23,14 +21,7 @@ export default function NextSteps(props: { chain: ChainMetadata }) {
2321
}
2422
className="before:absolute before:inset-0"
2523
target="_blank"
26-
onClick={() =>
27-
trackEvent({
28-
category: "nextSteps",
29-
action: "click-inapp",
30-
label: "success",
31-
chain_id: chain.chainId,
32-
})
33-
}
24+
rel="noopener noreferrer"
3425
>
3526
Create a login for {chain.name}
3627
</Link>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/BuyFundsSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export function BuyFundsSection(props: {
5656
href="https://portal.thirdweb.com/connect/pay/overview"
5757
className="inline-flex items-center gap-1.5 text-muted-foreground text-sm hover:text-foreground"
5858
target="_blank"
59+
rel="noopener noreferrer"
5960
>
6061
Learn more about Universal Bridge
6162
<ExternalLinkIcon className="size-3" />

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/ChainOverviewSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function ChainOverviewSection(props: { chain: ChainMetadata }) {
1818
<Link
1919
href={chain.infoURL}
2020
target="_blank"
21+
rel="noopener noreferrer"
2122
className="inline-flex items-center gap-1.5 hover:text-link-foreground"
2223
>
2324
{new URL(chain.infoURL).hostname}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/ClaimChainSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function ClaimChainSection() {
1919
className="gap-2"
2020
href="https://share.hsforms.com/1qAViW3U5SoKbabNhRZy4Kgea58c"
2121
target="_blank"
22+
rel="noopener noreferrer"
2223
>
2324
<span>Claim Chain</span>
2425
<ExternalLinkIcon className="-mt-[3px] size-4" />

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/SupportedProductsSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function SupportedProductsSection(props: {
3535
href={product.link}
3636
className="before:absolute before:inset-0"
3737
target="_blank"
38+
rel="noopener noreferrer"
3839
>
3940
{product.name}
4041
</Link>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/chain-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function ChainHeader(props: ChainHeaderProps) {
6161
}
6262
/>
6363
<Button variant="default" asChild>
64-
<Link href="/team" target="_blank">
64+
<Link href="/team" target="_blank" rel="noopener noreferrer">
6565
Get started with thirdweb
6666
</Link>
6767
</Button>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/explorer-section.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export function ExplorersSection(props: {
2323
<Link
2424
href={explorer.url}
2525
target="_blank"
26+
rel="noopener noreferrer"
2627
className="flex items-center gap-1.5 text-muted-foreground text-sm before:absolute before:inset-0 before:z-0"
2728
>
2829
{explorer.url.endsWith("/")

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ export default async function ChainPageLayout(props: {
176176
mapV4ChainToV5Chain(chain)
177177
}
178178
/>
179-
<Button variant="primary">
180-
<Link href="/team" target="_blank">
179+
<Button variant="primary" asChild>
180+
<Link href="/team" target="_blank" rel="noopener noreferrer">
181181
Get started
182182
</Link>
183183
</Button>

0 commit comments

Comments
 (0)