Skip to content

Commit c63b349

Browse files
authored
Feature: New Payments Overview Page (#7691)
1 parent 74a2163 commit c63b349

34 files changed

+236
-34
lines changed

apps/dashboard/redirects.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,20 @@ const projectRoute = "/team/:team_slug/:project_slug";
6666

6767
const projectPageRedirects = [
6868
{
69-
destination: `${projectRoute}/universal-bridge/:path*`,
69+
destination: `${projectRoute}/payments/:path*`,
7070
permanent: false,
7171
source: `${projectRoute}/connect/pay/:path*`,
7272
},
7373
{
74-
destination: `${projectRoute}/universal-bridge/:path*`,
74+
destination: `${projectRoute}/payments/:path*`,
7575
permanent: false,
7676
source: `${projectRoute}/connect/universal-bridge/:path*`,
7777
},
78+
{
79+
destination: `${projectRoute}/payments/:path*`,
80+
permanent: false,
81+
source: `${projectRoute}/universal-bridge/:path*`,
82+
},
7883
{
7984
destination: `${projectRoute}/account-abstraction/:path*`,
8085
permanent: false,
@@ -375,12 +380,22 @@ async function redirects() {
375380
permanent: false,
376381
source: "/template/:slug",
377382
},
378-
// redirect /connect/pay to /universal-bridge
383+
// redirect /connect/pay to /payments
379384
{
380-
destination: "/universal-bridge",
381-
permanent: false,
385+
destination: "/payments",
386+
permanent: true,
382387
source: "/connect/pay",
383388
},
389+
{
390+
destination: "/payments",
391+
permanent: true,
392+
source: "/universal-bridge",
393+
},
394+
{
395+
destination: "/payments/:slug",
396+
permanent: true,
397+
source: "/universal-bridge/:slug",
398+
},
384399
// PREVIOUS CAMPAIGNS
385400
{
386401
destination: "/",

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,18 @@ export function reportUpsellShown(properties: UpsellParams) {
413413
export function reportUpsellClicked(properties: UpsellParams) {
414414
posthog.capture("upsell clicked", properties);
415415
}
416+
417+
// ----------------------------
418+
// PAYMENTS
419+
// ----------------------------
420+
421+
/**
422+
* ### Why do we need to report this event?
423+
* - To track conversions on payment overview page
424+
*
425+
* ### Who is responsible for this event?
426+
* @samina
427+
*/
428+
export function reportPaymentCardClick(properties: { id: string }) {
429+
posthog.capture("payment card clicked", properties);
430+
}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function ProductsSection(props: { teamSlug: string; projectSlug: string }) {
254254
{
255255
description:
256256
"Bridge, swap, and purchase cryptocurrencies with any fiat options or tokens via cross-chain routing",
257-
href: `/team/${props.teamSlug}/${props.projectSlug}/universal-bridge`,
257+
href: `/team/${props.teamSlug}/${props.projectSlug}/payments`,
258258
icon: PayIcon,
259259
title: "Payments",
260260
},

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function ProjectSidebarLayout(props: {
7979
group: "Monetize",
8080
links: [
8181
{
82-
href: `${layoutPath}/universal-bridge`,
82+
href: `${layoutPath}/payments`,
8383
icon: PayIcon,
8484
label: "Payments",
8585
},

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/components/TopChainsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TableHeader,
1414
TableRow,
1515
} from "@/components/ui/table";
16-
import { CardHeading } from "../../universal-bridge/components/common";
16+
import { CardHeading } from "../../payments/components/common";
1717

1818
export function TopInsightChainsTable(props: {
1919
data: InsightChainStats[];

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/components/TopEndpointsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TableHeader,
1414
TableRow,
1515
} from "@/components/ui/table";
16-
import { CardHeading } from "../../universal-bridge/components/common";
16+
import { CardHeading } from "../../payments/components/common";
1717

1818
export function TopInsightEndpointsTable(props: {
1919
data: InsightEndpointStats[];

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ function AppHighlightsCard({
423423
emptyContent: (
424424
<EmptyStateContent
425425
description="Your app hasn't collected any fees yet."
426-
link={`/team/${params.team_slug}/${params.project_slug}/connect/universal-bridge/settings`}
426+
link={`/team/${params.team_slug}/${params.project_slug}/payments/settings`}
427427
metric="Fees"
428428
/>
429429
),

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/page.tsx renamed to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/analytics/page.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { getAuthToken } from "@/api/auth-token";
55
import { getProject } from "@/api/projects";
66
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
77
import { loginRedirect } from "@/utils/redirects";
8-
import { PayAnalytics } from "./components/PayAnalytics";
9-
import { getUniversalBridgeFiltersFromSearchParams } from "./components/time";
8+
import { PayAnalytics } from "../components/PayAnalytics";
9+
import { getUniversalBridgeFiltersFromSearchParams } from "../components/time";
1010

1111
export default async function Page(props: {
1212
params: Promise<{
@@ -24,9 +24,7 @@ export default async function Page(props: {
2424
const project = await getProject(params.team_slug, params.project_slug);
2525

2626
if (!authToken) {
27-
loginRedirect(
28-
`/team/${params.team_slug}/${params.project_slug}/universal-bridge`,
29-
);
27+
loginRedirect(`/team/${params.team_slug}/${params.project_slug}/payments`);
3028
}
3129

3230
if (!project) {
@@ -70,7 +68,7 @@ export default async function Page(props: {
7068
</div>
7169
<a
7270
className="inline-flex items-center gap-2 rounded-md bg-green-600 px-4 py-2 font-medium text-sm text-white transition-all hover:bg-green-600/90 hover:shadow-sm"
73-
href="https://portal.thirdweb.com/pay"
71+
href="https://portal.thirdweb.com/payments"
7472
rel="noopener noreferrer"
7573
target="_blank"
7674
>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { TabButtons } from "@/components/ui/tabs";
88

99
type Tab = "embed" | "sdk" | "api";
1010

11-
export function PayEmbedFTUX(props: {
11+
export function BuyWidgetFTUX(props: {
1212
clientId: string;
1313
codeExamples: {
1414
embed: React.ReactNode;
@@ -21,7 +21,7 @@ export function PayEmbedFTUX(props: {
2121
<div className="rounded-lg border bg-card">
2222
<div className="border-b border-dashed p-4">
2323
<h2 className="font-semibold text-lg tracking-tight">
24-
Start Monetizing Your App
24+
Setup Payments to View Analytics
2525
</h2>
2626
</div>
2727

@@ -56,7 +56,7 @@ export function PayEmbedFTUX(props: {
5656
<Button asChild size="sm" variant="outline">
5757
<Link
5858
className="gap-2"
59-
href="https://portal.thirdweb.com/pay"
59+
href="https://portal.thirdweb.com/payments"
6060
rel="noopener noreferrer"
6161
target="_blank"
6262
>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"use client";
2+
3+
import Link from "next/link";
4+
import { reportPaymentCardClick } from "@/analytics/report";
5+
import { Button } from "@/components/ui/button";
6+
import { Card } from "@/components/ui/card";
7+
8+
export function FeatureCard(props: {
9+
title: string;
10+
description: string;
11+
icon: React.ReactNode;
12+
id: string;
13+
link: { href: string; label: string; target?: string };
14+
}) {
15+
return (
16+
<Card className="p-4 flex flex-col items-start gap-4">
17+
<div className="text-muted-foreground rounded-full border bg-background size-12 flex items-center justify-center">
18+
{props.icon}
19+
</div>
20+
<div className="flex flex-col gap-0.5">
21+
<h3 className="font-semibold">{props.title}</h3>
22+
<p className="text-muted-foreground text-sm">{props.description}</p>
23+
</div>
24+
<Button
25+
onClick={() => reportPaymentCardClick({ id: props.id })}
26+
size="sm"
27+
variant="default"
28+
className="h-8"
29+
asChild
30+
>
31+
<Link href={props.link.href} target={props.link.target}>
32+
{props.link.label}
33+
</Link>
34+
</Button>
35+
</Card>
36+
);
37+
}

0 commit comments

Comments
 (0)