Skip to content

Commit fe0afb4

Browse files
committed
Update headers
1 parent 25c63c6 commit fe0afb4

File tree

6 files changed

+172
-103
lines changed

6 files changed

+172
-103
lines changed

apps/dashboard/src/@/components/blocks/project-page/project-page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import {
1212
type ProjectPageProps = {
1313
header: ProjectPageHeaderProps;
1414
footer?: ProjectPageFooterProps;
15-
/**
16-
* @deprecated only for legacy pages where we still need internal tabs for the moment, currently:
17-
* - /webhooks
18-
*/
1915
tabs?: TabPathLink[];
2016
};
2117

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
@@ -53,7 +53,7 @@ export function ProjectSidebarLayout(props: {
5353
},
5454
{
5555
href: `${props.layoutPath}/wallets/sponsored-gas`,
56-
label: "Sponsored Gas",
56+
label: "Gas Sponsorship",
5757
},
5858
],
5959
},

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

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { TabPathLinks } from "@/components/ui/tabs";
1+
import { redirect } from "next/navigation";
2+
import { getAuthToken } from "@/api/auth-token";
3+
import { getProject } from "@/api/project/projects";
4+
import { ProjectPage } from "@/components/blocks/project-page/project-page";
5+
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
6+
import { WalletProductIcon } from "@/icons/WalletProductIcon";
7+
import { loginRedirect } from "@/utils/redirects";
28

39
export default async function Layout(props: {
410
children: React.ReactNode;
@@ -7,22 +13,61 @@ export default async function Layout(props: {
713
const params = await props.params;
814
const basePath = `/team/${params.team_slug}/${params.project_slug}/wallets/server-wallets`;
915

16+
const [authToken, project] = await Promise.all([
17+
getAuthToken(),
18+
getProject(params.team_slug, params.project_slug),
19+
]);
20+
21+
if (!authToken) {
22+
loginRedirect(basePath);
23+
}
24+
25+
if (!project) {
26+
redirect(`/team/${params.team_slug}`);
27+
}
28+
29+
const client = getClientThirdwebClient({
30+
jwt: authToken,
31+
teamId: project.teamId,
32+
});
33+
1034
return (
11-
<div className="flex flex-col gap-6">
12-
<TabPathLinks
13-
links={[
35+
<ProjectPage
36+
header={{
37+
icon: WalletProductIcon,
38+
title: "Server Wallets",
39+
description:
40+
"Wallet used to relay transactions from your backend at scale",
41+
actions: null,
42+
client,
43+
links: [
44+
{
45+
type: "docs",
46+
href: "https://portal.thirdweb.com/wallets/server",
47+
},
1448
{
15-
name: "Overview",
16-
path: `${basePath}`,
17-
exactMatch: true,
49+
type: "playground",
50+
href: "https://playground.thirdweb.com/wallets/in-app-wallet",
1851
},
1952
{
20-
name: "Configuration",
21-
path: `${basePath}/configuration`,
53+
type: "api",
54+
href: "https://api.thirdweb.com/reference#tag/wallets",
2255
},
23-
]}
24-
/>
56+
],
57+
}}
58+
tabs={[
59+
{
60+
name: "Overview",
61+
path: `${basePath}`,
62+
exactMatch: true,
63+
},
64+
{
65+
name: "Configuration",
66+
path: `${basePath}/configuration`,
67+
},
68+
]}
69+
>
2570
{props.children}
26-
</div>
71+
</ProjectPage>
2772
);
2873
}
Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { TabPathLinks } from "@/components/ui/tabs";
1+
import { redirect } from "next/navigation";
2+
import { getAuthToken } from "@/api/auth-token";
3+
import { getProject } from "@/api/project/projects";
4+
import { ProjectPage } from "@/components/blocks/project-page/project-page";
5+
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
6+
import { WalletProductIcon } from "@/icons/WalletProductIcon";
7+
import { loginRedirect } from "@/utils/redirects";
28

39
export default async function Layout(props: {
410
children: React.ReactNode;
@@ -7,22 +13,61 @@ export default async function Layout(props: {
713
const params = await props.params;
814
const basePath = `/team/${params.team_slug}/${params.project_slug}/wallets/sponsored-gas`;
915

16+
const [authToken, project] = await Promise.all([
17+
getAuthToken(),
18+
getProject(params.team_slug, params.project_slug),
19+
]);
20+
21+
if (!authToken) {
22+
loginRedirect(basePath);
23+
}
24+
25+
if (!project) {
26+
redirect(`/team/${params.team_slug}`);
27+
}
28+
29+
const client = getClientThirdwebClient({
30+
jwt: authToken,
31+
teamId: project.teamId,
32+
});
33+
1034
return (
11-
<div className="flex flex-col gap-6">
12-
<TabPathLinks
13-
links={[
35+
<ProjectPage
36+
header={{
37+
icon: WalletProductIcon,
38+
title: "Gas Sponsorship",
39+
description:
40+
"Cover gas fees on behalf of your users for a seamless onboarding experience",
41+
actions: null,
42+
client,
43+
links: [
44+
{
45+
type: "docs",
46+
href: "https://portal.thirdweb.com/transactions/sponsor",
47+
},
1448
{
15-
name: "Overview",
16-
path: `${basePath}`,
17-
exactMatch: true,
49+
type: "playground",
50+
href: "https://playground.thirdweb.com/wallets/in-app-wallet",
1851
},
1952
{
20-
name: "Configuration",
21-
path: `${basePath}/configuration`,
53+
type: "api",
54+
href: "https://api.thirdweb.com/reference#tag/wallets",
2255
},
23-
]}
24-
/>
56+
],
57+
}}
58+
tabs={[
59+
{
60+
name: "Overview",
61+
path: `${basePath}`,
62+
exactMatch: true,
63+
},
64+
{
65+
name: "Configuration",
66+
path: `${basePath}/configuration`,
67+
},
68+
]}
69+
>
2570
{props.children}
26-
</div>
71+
</ProjectPage>
2772
);
2873
}
Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { TabPathLinks } from "@/components/ui/tabs";
1+
import { redirect } from "next/navigation";
2+
import { getAuthToken } from "@/api/auth-token";
3+
import { getProject } from "@/api/project/projects";
4+
import { ProjectPage } from "@/components/blocks/project-page/project-page";
5+
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
6+
import { WalletProductIcon } from "@/icons/WalletProductIcon";
7+
import { loginRedirect } from "@/utils/redirects";
28

39
export default async function Layout(props: {
410
children: React.ReactNode;
@@ -7,22 +13,61 @@ export default async function Layout(props: {
713
const params = await props.params;
814
const basePath = `/team/${params.team_slug}/${params.project_slug}/wallets/user-wallets`;
915

16+
const [authToken, project] = await Promise.all([
17+
getAuthToken(),
18+
getProject(params.team_slug, params.project_slug),
19+
]);
20+
21+
if (!authToken) {
22+
loginRedirect(basePath);
23+
}
24+
25+
if (!project) {
26+
redirect(`/team/${params.team_slug}`);
27+
}
28+
29+
const client = getClientThirdwebClient({
30+
jwt: authToken,
31+
teamId: project.teamId,
32+
});
33+
1034
return (
11-
<div className="flex flex-col gap-6">
12-
<TabPathLinks
13-
links={[
35+
<ProjectPage
36+
header={{
37+
icon: WalletProductIcon,
38+
title: "User Wallets",
39+
description:
40+
"Secure, auto-generated wallets created for authenticated users using email, socials, or passkeys",
41+
actions: null,
42+
client,
43+
links: [
44+
{
45+
type: "docs",
46+
href: "https://portal.thirdweb.com/wallets/users",
47+
},
1448
{
15-
name: "Overview",
16-
path: `${basePath}`,
17-
exactMatch: true,
49+
type: "playground",
50+
href: "https://playground.thirdweb.com/wallets/in-app-wallet",
1851
},
1952
{
20-
name: "Configuration",
21-
path: `${basePath}/configuration`,
53+
type: "api",
54+
href: "https://api.thirdweb.com/reference#tag/wallets",
2255
},
23-
]}
24-
/>
56+
],
57+
}}
58+
tabs={[
59+
{
60+
name: "Overview",
61+
path: `${basePath}`,
62+
exactMatch: true,
63+
},
64+
{
65+
name: "Configuration",
66+
path: `${basePath}/configuration`,
67+
},
68+
]}
69+
>
2570
{props.children}
26-
</div>
71+
</ProjectPage>
2772
);
2873
}

0 commit comments

Comments
 (0)