-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { APIHeader } from "@/components/blocks/APIHeader"; | ||
import { | ||
WalletIconBasic, | ||
WalletNameBasic, | ||
WalletNameFormat, | ||
} from "@/components/headless-ui/wallet-examples"; | ||
|
||
import ThirdwebProvider from "@/components/thirdweb-provider"; | ||
import { metadataBase } from "@/lib/constants"; | ||
import type { Metadata } from "next"; | ||
|
||
export const metadata: Metadata = { | ||
metadataBase, | ||
title: "Wallet Components", | ||
description: | ||
"Boost your crypto wallet applications with our React headless UI components, optimized for digital asset management. These flexible, unstyled elements simplify cryptocurrency operations while granting developers complete control over the user interface design.", | ||
}; | ||
|
||
export default function Page() { | ||
return ( | ||
<ThirdwebProvider> | ||
<main className="container px-0 pb-20"> | ||
<APIHeader | ||
title="Wallet Components" | ||
description={ | ||
<> | ||
Boost your crypto wallet applications with our React headless UI | ||
components, optimized for digital asset management. These | ||
flexible, unstyled elements simplify cryptocurrency operations | ||
while granting developers complete control over the user interface | ||
design. | ||
</> | ||
} | ||
docsLink="https://portal.thirdweb.com/react/v5/connecting-wallets/ui-components" | ||
heroLink="/headless-ui-header.png" | ||
/> | ||
<section className="space-y-8"> | ||
<WalletIconBasic /> | ||
</section> | ||
<section className="space-y-8"> | ||
<WalletNameBasic /> | ||
</section> | ||
<section className="space-y-8"> | ||
<WalletNameFormat /> | ||
</section> | ||
</main> | ||
</ThirdwebProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
apps/playground-web/src/components/headless-ui/wallet-examples.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
"use client"; | ||
|
||
import { WalletIcon, WalletName, WalletProvider } from "thirdweb/react"; | ||
import { CodeExample } from "../code/code-example"; | ||
|
||
export function WalletIconBasic() { | ||
return ( | ||
<> | ||
<div className="space-y-2"> | ||
<h2 className="font-semibold text-2xl tracking-tight sm:text-3xl"> | ||
WalletIcon | ||
</h2> | ||
<p className="max-w-[600px] text-lg"> | ||
Show the icon of a crypto wallet | ||
</p> | ||
</div> | ||
|
||
<CodeExample | ||
preview={ | ||
<WalletProvider id="io.metamask"> | ||
<WalletIcon | ||
className="h-20 w-20 rounded-full" | ||
loadingComponent={<span>Loading...</span>} | ||
/> | ||
</WalletProvider> | ||
} | ||
code={`import { WalletProvider, WalletIcon } from "thirdweb/react"; | ||
function App() { | ||
return ( | ||
<WalletProvider id="io.metamask"> | ||
<WalletIcon | ||
className="h-20 w-20 rounded-full" | ||
loadingComponent={<span>Loading...</span>} | ||
/> | ||
</WalletProvider> | ||
) | ||
}`} | ||
lang="tsx" | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
export function WalletNameBasic() { | ||
return ( | ||
<> | ||
<div className="mt-8 space-y-2"> | ||
<h2 className="font-semibold text-2xl tracking-tight sm:text-3xl"> | ||
WalletName | ||
</h2> | ||
<p className="max-w-[600px] text-lg"> | ||
Show the name of a crypto wallet | ||
</p> | ||
</div> | ||
|
||
<CodeExample | ||
preview={ | ||
<WalletProvider id="io.metamask"> | ||
<WalletName loadingComponent={<span>Loading...</span>} /> | ||
</WalletProvider> | ||
} | ||
code={`import { WalletProvider, WalletName } from "thirdweb/react"; | ||
function App() { | ||
return ( | ||
<WalletProvider id="io.metamask"> | ||
<WalletName loadingComponent={<span>Loading...</span>} /> | ||
</WalletProvider> | ||
) | ||
}`} | ||
lang="tsx" | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
export function WalletNameFormat() { | ||
return ( | ||
<> | ||
<div className="mt-8 space-y-2"> | ||
<p className="max-w-[600px] text-lg"> | ||
Transform the wallet name using the <b>formatFn</b> prop. | ||
</p> | ||
</div> | ||
|
||
<CodeExample | ||
preview={ | ||
<WalletProvider id="io.metamask"> | ||
<WalletName formatFn={(str: string) => `${str} Wallet`} /> | ||
</WalletProvider> | ||
} | ||
code={`import { WalletProvider, WalletName } from "thirdweb/react"; | ||
function App() { | ||
return ( | ||
<WalletProvider id="io.metamask"> | ||
<WalletName | ||
loadingComponent={<span>Loading...</span>} | ||
formatFn={(str: string) => \`\${str} Wallet\`} | ||
/> | ||
</WalletProvider> | ||
) | ||
}`} | ||
lang="tsx" | ||
/> | ||
</> | ||
); | ||
} |