Skip to content

Commit d13c6f8

Browse files
committed
update
1 parent 56833ce commit d13c6f8

File tree

4 files changed

+126
-1
lines changed

4 files changed

+126
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { APIHeader } from "@/components/blocks/APIHeader";
2+
import {
3+
ChainIconBasic,
4+
ChainNameBasic,
5+
} from "@/components/headless-ui/chain-examples";
6+
import ThirdwebProvider from "@/components/thirdweb-provider";
7+
import { metadataBase } from "@/lib/constants";
8+
import type { Metadata } from "next";
9+
10+
export const metadata: Metadata = {
11+
metadataBase,
12+
title: "Chain Components",
13+
description:
14+
"Enhance your applications with our Chain components, featuring a collection of chain icons, names, and symbols. These customizable components simplify the integration of blockchain information, allowing developers to easily display and manage multiple chains in their user interfaces.",
15+
};
16+
17+
export default function Page() {
18+
return (
19+
<ThirdwebProvider>
20+
<main className="container px-0 pb-20">
21+
<APIHeader
22+
title="Token Components"
23+
description={
24+
<>
25+
Enhance your applications with our Chain components, featuring a
26+
collection of chain icons, names, and symbols. These customizable
27+
components simplify the integration of blockchain information,
28+
allowing developers to easily display and manage multiple chains
29+
in their user interfaces.
30+
</>
31+
}
32+
docsLink="https://portal.thirdweb.com/react/v5/components/onchain#chains"
33+
heroLink="/headless-ui-header.png"
34+
/>
35+
<section className="space-y-8">
36+
<ChainIconBasic />
37+
</section>
38+
<section className="space-y-8">
39+
<ChainNameBasic />
40+
</section>
41+
</main>
42+
</ThirdwebProvider>
43+
);
44+
}

apps/playground-web/src/app/connect/ui/token/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { APIHeader } from "@/components/blocks/APIHeader";
2-
import {} from "@/components/headless-ui/nft-examples";
32
import {
43
TokenCard,
54
TokenImageBasic,

apps/playground-web/src/app/navLinks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ export const navLinks: SidebarLink[] = [
127127
name: "Token",
128128
href: "/connect/ui/token",
129129
},
130+
{
131+
name: "Chain",
132+
href: "/connect/ui/chain",
133+
},
130134
],
131135
},
132136
];
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
"use client";
2+
3+
import { THIRDWEB_CLIENT } from "@/lib/client";
4+
import { avalanche } from "thirdweb/chains";
5+
import { ChainIcon, ChainName, ChainProvider } from "thirdweb/react";
6+
import { CodeExample } from "../code/code-example";
7+
8+
export function ChainIconBasic() {
9+
return (
10+
<>
11+
<div className="space-y-2">
12+
<h2 className="font-semibold text-2xl tracking-tight sm:text-3xl">
13+
ChainIcon
14+
</h2>
15+
<p className="max-w-[600px] text-lg">
16+
Show the native icon of a network
17+
</p>
18+
</div>
19+
20+
<CodeExample
21+
preview={
22+
<ChainProvider chain={avalanche}>
23+
<ChainIcon
24+
client={THIRDWEB_CLIENT}
25+
className="h-auto w-20 rounded-full"
26+
loadingComponent={<span>Loading...</span>}
27+
/>
28+
</ChainProvider>
29+
}
30+
code={`import { ChainProvider, ChainIcon } from "thirdweb/react";
31+
32+
function App() {
33+
return (
34+
<ChainProvider chain={avalanche}>
35+
<ChainIcon
36+
client={THIRDWEB_CLIENT}
37+
className="h-auto w-20 rounded-full"
38+
loadingComponent={<span>Loading...</span>}
39+
/>
40+
</ChainProvider>
41+
)
42+
}`}
43+
lang="tsx"
44+
/>
45+
</>
46+
);
47+
}
48+
49+
export function ChainNameBasic() {
50+
return (
51+
<>
52+
<div className="mt-8 space-y-2">
53+
<h2 className="font-semibold text-2xl tracking-tight sm:text-3xl">
54+
ChainName
55+
</h2>
56+
<p className="max-w-[600px] text-lg">Show the name of the token</p>
57+
</div>
58+
59+
<CodeExample
60+
preview={
61+
<ChainProvider chain={avalanche}>
62+
<ChainName loadingComponent={<span>Loading...</span>} />
63+
</ChainProvider>
64+
}
65+
code={`import { ChainProvider, ChainName } from "thirdweb/react";
66+
67+
function App() {
68+
return (
69+
<ChainProvider chain={avalanche}>
70+
<ChainName loadingComponent={<span>Loading...</span>} />
71+
</ChainProvider>
72+
)
73+
}`}
74+
lang="tsx"
75+
/>
76+
</>
77+
);
78+
}

0 commit comments

Comments
 (0)