Skip to content

Commit 3a54d01

Browse files
committed
[TOOL-3683] Dashboard: show FTUX in team overview page when no projects are created
1 parent a1141f3 commit 3a54d01

File tree

6 files changed

+541
-280
lines changed

6 files changed

+541
-280
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import { subDays } from "date-fns";
66
import { redirect } from "next/navigation";
77
import { getAuthToken } from "../../../api/lib/getAuthToken";
88
import { loginRedirect } from "../../../login/loginRedirect";
9-
import {
10-
type ProjectWithAnalytics,
11-
TeamProjectsPage,
12-
} from "./~/projects/TeamProjectsPage";
9+
import { TeamProjectsPage } from "./~/projects/TeamProjectsPage";
10+
import type { ProjectWithAnalytics } from "./~/projects/TeamProjectsTable";
1311

1412
export default async function Page(props: {
1513
params: Promise<{ team_slug: string }>;
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
"use client";
2+
import { Button } from "@/components/ui/button";
3+
import {
4+
BookTextIcon,
5+
BookUpIcon,
6+
DatabaseIcon,
7+
DollarSignIcon,
8+
FuelIcon,
9+
PlusIcon,
10+
SparklesIcon,
11+
SquareChevronRightIcon,
12+
WalletIcon,
13+
} from "lucide-react";
14+
import Link from "next/link";
15+
16+
export function NoProjectsFTUX(props: {
17+
openCreateProjectModal: () => void;
18+
}) {
19+
return (
20+
<div className="">
21+
<div className="flex flex-col justify-between gap-5 lg:flex-row lg:items-center">
22+
<div>
23+
<h2 className="mb-1 font-semibold text-2xl tracking-tight">
24+
Create a project to use thirdweb services
25+
</h2>
26+
<p className="text-muted-foreground text-sm">
27+
Creating a project gives you access to thirdweb's services for
28+
building powerful web3 applications
29+
</p>
30+
</div>
31+
32+
<Button onClick={props.openCreateProjectModal} className="gap-2">
33+
<PlusIcon className="size-4" />
34+
Create Project
35+
</Button>
36+
</div>
37+
<div className="h-6" />
38+
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
39+
<FeatureCard
40+
icon={BookUpIcon}
41+
title="Deploy Contracts"
42+
description="Securely deploy, build, and manage contracts on any EVM chain."
43+
documentationUrl="https://portal.thirdweb.com/contracts"
44+
playgroundUrl={undefined}
45+
/>
46+
<FeatureCard
47+
icon={WalletIcon}
48+
title="Create In-App Wallets"
49+
description="Create social, passkey, and mobile login options for easy user onboarding."
50+
documentationUrl="https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure"
51+
playgroundUrl="https://playground.thirdweb.com/connect/in-app-wallet"
52+
/>
53+
<FeatureCard
54+
icon={FuelIcon}
55+
title="Sponsor Gas Funds"
56+
description="Sponsor gas and enable secure app scope for your users using ERC-4337 compliant smart accounts."
57+
documentationUrl="https://portal.thirdweb.com/connect/account-abstraction/overview"
58+
playgroundUrl="https://playground.thirdweb.com/connect/account-abstraction/connect"
59+
/>
60+
<FeatureCard
61+
icon={DatabaseIcon}
62+
title="Index Any EVM Chain"
63+
description="Index any EVM chain to aggregate and display onchain data in your application."
64+
documentationUrl="https://portal.thirdweb.com/insight"
65+
playgroundUrl="https://playground.thirdweb.com/insight"
66+
/>
67+
68+
<FeatureCard
69+
icon={SparklesIcon}
70+
title="Integrate AI"
71+
description="Build AI powered crypto applications with advanced capabilities."
72+
documentationUrl="https://portal.thirdweb.com/nebula"
73+
playgroundUrl="https://nebula.thirdweb.com"
74+
/>
75+
76+
<FeatureCard
77+
icon={DollarSignIcon}
78+
title="Fiat & cross-chain crypto payments "
79+
description="Bridge, swap, purchase cryptocurrencies and execute transactions with fiat or tokens via cross-chain routing"
80+
documentationUrl="https://portal.thirdweb.com/connect/pay/overview"
81+
playgroundUrl="https://playground.thirdweb.com/connect/pay"
82+
/>
83+
</div>
84+
</div>
85+
);
86+
}
87+
88+
function FeatureCard(props: {
89+
icon: React.FC<{ className?: string }>;
90+
title: string;
91+
description: string;
92+
documentationUrl: string;
93+
playgroundUrl: string | undefined;
94+
}) {
95+
return (
96+
<div className="rounded-lg border bg-card p-4">
97+
<div className="mb-4 inline-flex rounded-full border p-3">
98+
<props.icon className="size-5 text-muted-foreground" />
99+
</div>
100+
<h3 className="mb-1 font-semibold text-lg">{props.title}</h3>
101+
<p className="mb-6 text-muted-foreground text-sm">{props.description}</p>
102+
<div className="mt-auto flex gap-2.5">
103+
<Button variant="outline" size="sm" className="gap-2 text-xs" asChild>
104+
<Link href={props.documentationUrl} target="_blank">
105+
<BookTextIcon className="size-3 text-muted-foreground" />
106+
Documentation
107+
</Link>
108+
</Button>
109+
{props.playgroundUrl && (
110+
<Button variant="outline" size="sm" className="gap-2 text-xs" asChild>
111+
<Link href={props.playgroundUrl} target="_blank">
112+
<SquareChevronRightIcon className="size-3 text-muted-foreground" />
113+
Playground
114+
</Link>
115+
</Button>
116+
)}
117+
</div>
118+
</div>
119+
);
120+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
import { NoProjectsFTUX } from "./NoProjectsFTUX";
3+
4+
const meta = {
5+
title: "Team/No Projects FTUX",
6+
component: NoProjectsFTUX,
7+
parameters: {
8+
nextjs: {
9+
appDirectory: true,
10+
},
11+
},
12+
decorators: [
13+
(Story) => (
14+
<div className="container py-10">
15+
<Story />
16+
</div>
17+
),
18+
],
19+
} satisfies Meta<typeof NoProjectsFTUX>;
20+
21+
export default meta;
22+
type Story = StoryObj<typeof meta>;
23+
24+
export const Default: Story = {
25+
args: {
26+
openCreateProjectModal: () => {},
27+
},
28+
};

0 commit comments

Comments
 (0)