Skip to content

Commit 4d0bcb1

Browse files
committed
Dashboard: Bridge page UI adjustments, add tracking
1 parent a94e9c2 commit 4d0bcb1

File tree

5 files changed

+93
-44
lines changed

5 files changed

+93
-44
lines changed

apps/dashboard/src/@/analytics/report.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,3 +691,17 @@ export function reportProductFeedback(properties: {
691691
source: properties.source,
692692
});
693693
}
694+
695+
/**
696+
* ### Why do we need to report this event?
697+
* - To track conversions for the bridge page links
698+
*
699+
* ### Who is responsible for this event?
700+
* @MananTank
701+
*
702+
*/
703+
export function reportBridgePageLinkClick(params: {
704+
linkType: "integrate-bridge" | "trending-tokens";
705+
}) {
706+
posthog.capture("bridge page link clicked", params);
707+
}

apps/dashboard/src/@/components/blocks/faq-section.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@ export function FaqSection(props: {
99
faqs: Array<{ title: string; description: string }>;
1010
}) {
1111
return (
12-
<div className="py-10">
13-
<section className="">
14-
<h2 className="text-2xl md:text-3xl font-semibold mb-4 tracking-tight">
15-
Frequently asked questions
16-
</h2>
17-
<div className="flex flex-col">
18-
{props.faqs.map((faq, faqIndex) => (
19-
<FaqItem
20-
key={faq.title}
21-
title={faq.title}
22-
description={faq.description}
23-
className={cn(faqIndex === props.faqs.length - 1 && "border-b-0")}
24-
/>
25-
))}
26-
</div>
27-
</section>
28-
</div>
12+
<section>
13+
<h2 className="text-2xl md:text-3xl font-semibold mb-4 tracking-tight">
14+
Frequently asked questions
15+
</h2>
16+
<div className="flex flex-col">
17+
{props.faqs.map((faq, faqIndex) => (
18+
<FaqItem
19+
key={faq.title}
20+
title={faq.title}
21+
description={faq.description}
22+
className={cn(faqIndex === props.faqs.length - 1 && "border-b-0")}
23+
/>
24+
))}
25+
</div>
26+
</section>
2927
);
3028
}
3129

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ export default async function Page(props: Props) {
6767
)}
6868

6969
{chainSeo?.faqs && chainSeo.faqs.length > 0 && (
70-
<FaqSection faqs={chainSeo.faqs} />
70+
<div className="py-10">
71+
<FaqSection faqs={chainSeo.faqs} />
72+
</div>
7173
)}
7274
</div>
7375
);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"use client";
2+
import { ChevronRightIcon, DollarSignIcon, TrendingUpIcon } from "lucide-react";
3+
import Link from "next/link";
4+
import { reportBridgePageLinkClick } from "@/analytics/report";
5+
import { cn } from "@/lib/utils";
6+
7+
export function PillLink(props: {
8+
children: React.ReactNode;
9+
href: string;
10+
linkType: "integrate-bridge" | "trending-tokens";
11+
}) {
12+
const Icon =
13+
props.linkType === "integrate-bridge" ? DollarSignIcon : TrendingUpIcon;
14+
return (
15+
<Link
16+
href={props.href}
17+
target="_blank"
18+
onClick={() => reportBridgePageLinkClick({ linkType: props.linkType })}
19+
className={cn(
20+
"shadow-sm text-center justify-center inline-flex items-center gap-4 text-foreground group",
21+
"text-sm bg-card/50 backdrop-blur-lg border border-border/70",
22+
"rounded-full px-4 py-2.5 transition-colors duration-300 text-pretty leading-5",
23+
"hover:bg-pink-300/20 dark:hover:bg-pink-950/30 hover:text-foreground hover:border-pink-400 dark:hover:border-pink-800",
24+
)}
25+
>
26+
<div className="flex items-center gap-2.5">
27+
<Icon className="size-4 shrink-0 text-pink-600" />
28+
{props.children}
29+
</div>
30+
<ChevronRightIcon className="size-4 shrink-0 text-muted-foreground/50 group-hover:translate-x-1 transition-all duration-300 group-hover:text-foreground" />
31+
</Link>
32+
);
33+
}

apps/dashboard/src/app/bridge/page.tsx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { cn } from "@workspace/ui/lib/utils";
2-
import { ChevronRightIcon } from "lucide-react";
32
import type { Metadata } from "next";
4-
import Link from "next/link";
53
import type { Address } from "thirdweb";
64
import { defineChain } from "thirdweb/chains";
75
import { getContract } from "thirdweb/contract";
86
import { getCurrencyMetadata } from "thirdweb/extensions/erc20";
97
import { FaqSection } from "@/components/blocks/faq-section";
108
import { AppFooter } from "@/components/footers/app-footer";
119
import { BridgeVeil } from "./components/BridgeVeil";
10+
import { PillLink } from "./components/client/pill-link";
1211
import { UniversalBridgeEmbed } from "./components/client/UniversalBridgeEmbed";
1312
import { PageHeader } from "./components/header";
1413
import { bridgeAppThirdwebClient } from "./constants";
@@ -56,15 +55,17 @@ export default async function BridgePage({
5655

5756
return (
5857
<div className="grow flex flex-col relative overflow-hidden">
59-
<div className="absolute top-0 left-0 right-0 h-dvh md:h-[1200px] fade-in-0 animate-in duration-1000">
58+
<div className="absolute top-0 left-0 right-0 h-dvh md:h-[1200px] fade-in-0 animate-in duration-700">
6059
<BridgeVeil />
6160
</div>
6261

6362
<div className="relative z-10">
6463
<PageHeader />
6564

66-
<div className="pt-28 pb-32 min-h-dvh relative z-10">
67-
<div className="container mb-20">
65+
<div className="h-20" />
66+
67+
<div className="relative z-10">
68+
<div className="container">
6869
<h1 className="text-5xl md:text-6xl font-bold mb-6 tracking-tighter text-center leading-none text-pretty">
6970
Bridge and Swap tokens <br className="max-sm:hidden" /> across any
7071
chain, instantly
@@ -77,6 +78,8 @@ export default async function BridgePage({
7778
</div>
7879
</div>
7980

81+
<div className="h-16" />
82+
8083
<div className="flex grow items-center justify-center px-4 relative">
8184
<DotsBackgroundPattern />
8285
<UniversalBridgeEmbed
@@ -95,21 +98,33 @@ export default async function BridgePage({
9598
</div>
9699
</div>
97100

98-
<div className="mb-24 container max-w-4xl">
99-
<BridgeFaqSection />
100-
</div>
101+
<div className="h-32" />
101102

102-
<div className="flex flex-col gap-4 items-center mb-28 container">
103-
<PillLink href="https://portal.thirdweb.com/bridge">
103+
<div className="flex flex-col gap-4 items-center container">
104+
<PillLink
105+
href="https://portal.thirdweb.com/bridge"
106+
linkType="integrate-bridge"
107+
>
104108
Integrate Bridge in your apps in minutes, and start generating
105109
revenue
106110
</PillLink>
107111

108-
<PillLink href="https://thirdweb.com/tokens">
112+
<PillLink
113+
href="https://thirdweb.com/tokens"
114+
linkType="trending-tokens"
115+
>
109116
Discover Trending Tokens
110117
</PillLink>
111118
</div>
112119

120+
<div className="h-32" />
121+
122+
<div className="container max-w-2xl">
123+
<BridgeFaqSection />
124+
</div>
125+
126+
<div className="h-32" />
127+
113128
<div className="relative">
114129
<AppFooter />
115130
</div>
@@ -120,30 +135,17 @@ export default async function BridgePage({
120135

121136
function DataPill(props: { children: React.ReactNode }) {
122137
return (
123-
<p className="flex items-center gap-1.5 text-foreground/60 text-xs bg-accent/30 backdrop-blur-lg border border-border/70 rounded-full px-3 py-1.5 hover:text-foreground transition-colors duration-300">
138+
<p className="flex items-center gap-1.5 text-foreground/50 text-xs bg-accent/30 backdrop-blur-lg border border-border/70 rounded-full px-3 py-1.5 hover:text-foreground transition-colors duration-300">
124139
{props.children}
125140
</p>
126141
);
127142
}
128143

129-
function PillLink(props: { children: React.ReactNode; href: string }) {
130-
return (
131-
<Link
132-
href={props.href}
133-
target="_blank"
134-
className="shadow-lg text-center justify-center inline-flex items-center gap-2 text-foreground text-sm bg-card/50 backdrop-blur-lg border border-border/70 hover:border-active-border rounded-full px-5 py-2.5 hover:text-foreground transition-colors duration-300 text-pretty leading-5"
135-
>
136-
{props.children}
137-
<ChevronRightIcon className="size-3.5 shrink-0 text-muted-foreground" />
138-
</Link>
139-
);
140-
}
141-
142144
function DotsBackgroundPattern(props: { className?: string }) {
143145
return (
144146
<div
145147
className={cn(
146-
"pointer-events-none absolute -inset-20 text-foreground/30 dark:text-foreground/10",
148+
"pointer-events-none absolute -inset-x-36 -inset-y-24 text-pink-700/30 dark:text-pink-500/20",
147149
props.className,
148150
)}
149151
style={{

0 commit comments

Comments
 (0)