Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit 7269a5e

Browse files
committed
add a bit of documentation around ui components
1 parent 6583b11 commit 7269a5e

File tree

6 files changed

+92
-4
lines changed

6 files changed

+92
-4
lines changed

packages/thirdweb-react/docs/react.connectwallet.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,31 @@
44

55
## ConnectWallet variable
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
A component that allows the user to connect their wallet.
11+
12+
The button has to be wrapped in a `ThirdwebProvider` in order to function.
13+
714
<b>Signature:</b>
815

916
```typescript
1017
ConnectWallet: React.FC<ConnectWalletProps>
1118
```
19+
20+
## Example
21+
22+
23+
```javascript
24+
import { ConnectWallet } from '@thirdweb-dev/react';
25+
26+
const App = () => {
27+
return (
28+
<div>
29+
<ConnectWallet />
30+
</div>
31+
)
32+
}
33+
```
34+

packages/thirdweb-react/docs/react.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ import { useWalletConnect } from "@thirdweb-dev/react"
156156

157157
| Variable | Description |
158158
| --- | --- |
159-
| [ConnectWallet](./react.connectwallet.md) | |
159+
| [ConnectWallet](./react.connectwallet.md) | <p><b><i>(BETA)</i></b> A component that allows the user to connect their wallet.</p><p>The button has to be wrapped in a <code>ThirdwebProvider</code> in order to function.</p> |
160160
| [MediaRenderer](./react.mediarenderer.md) | <p>This component can be used to render any media type, including image, audio, video, and html files. Its convenient for rendering NFT media files, as these can be a variety of different types. The component falls back to a external link if the media type is not supported.</p><p>Props: [MediaRendererProps](./react.mediarendererprops.md)</p> |
161161
| [ThirdwebNftMedia](./react.thirdwebnftmedia.md) | <b><i>(BETA)</i></b> |
162162
| [ThirdwebProvider](./react.thirdwebprovider.md) | The <code>&lt;ThirdwebProvider /&gt;</code> component lets you control what networks you want users to connect to, what types of wallets can connect to your app, and the settings for the \[Typescript SDK\](https://docs.thirdweb.com/typescript). |
163163
| [ThirdwebSDKProvider](./react.thirdwebsdkprovider.md) | <p><b><i>(BETA)</i></b> A barebones wrapper around the Thirdweb SDK.</p><p>You can use this in order to be able to pass a provider &amp; signer directly to the SDK.</p> |
164-
| [Web3Button](./react.web3button.md) | |
164+
| [Web3Button](./react.web3button.md) | <p><b><i>(BETA)</i></b> A component that allows the user to call an on-chain function on a contract.</p><p>The button has to be wrapped in a <code>ThirdwebProvider</code> in order to function.</p> |
165165

166166
## Type Aliases
167167

packages/thirdweb-react/docs/react.web3button.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,31 @@
44

55
## Web3Button variable
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
A component that allows the user to call an on-chain function on a contract.
11+
12+
The button has to be wrapped in a `ThirdwebProvider` in order to function.
13+
714
<b>Signature:</b>
815

916
```typescript
1017
Web3Button: React.FC<PropsWithChildren<Web3ButtonProps>>
1118
```
19+
20+
## Example
21+
22+
23+
```javascript
24+
import { Web3Button } from '@thirdweb-dev/react';
25+
26+
const App = () => {
27+
return (
28+
<div>
29+
<Web3Button contractAddress="0x..." functionName="mint" />
30+
</div>
31+
)
32+
}
33+
```
34+

packages/thirdweb-react/etc/react.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export type ClaimTokenParams = {
153153

154154
// Warning: (ae-forgotten-export) The symbol "ConnectWalletProps" needs to be exported by the entry point thirdweb-dev-react.cjs.d.ts
155155
//
156-
// @public (undocumented)
156+
// @beta
157157
export const ConnectWallet: React_2.FC<ConnectWalletProps>;
158158

159159
// @beta
@@ -1847,7 +1847,7 @@ export type WalletLinkConnectorType = "walletLink" | "coinbase" | {
18471847

18481848
// Warning: (ae-forgotten-export) The symbol "Web3ButtonProps" needs to be exported by the entry point thirdweb-dev-react.cjs.d.ts
18491849
//
1850-
// @public (undocumented)
1850+
// @beta
18511851
export const Web3Button: React.FC<PropsWithChildren<Web3ButtonProps>>;
18521852

18531853
// Warnings were encountered during analysis:

packages/thirdweb-react/src/components/ConnectWallet/index.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,27 @@ const chainIdToCurrencyMap: Record<
8686
[ChainId.Mumbai]: "polygon",
8787
};
8888

89+
/**
90+
* A component that allows the user to connect their wallet.
91+
*
92+
* The button has to be wrapped in a `ThirdwebProvider` in order to function.
93+
*
94+
* @example
95+
* ```javascript
96+
* import { ConnectWallet } from '@thirdweb-dev/react';
97+
*
98+
* const App = () => {
99+
* return (
100+
* <div>
101+
* <ConnectWallet />
102+
* </div>
103+
* )
104+
* }
105+
* ```
106+
*
107+
*
108+
* @beta
109+
*/
89110
export const ConnectWallet: React.FC<ConnectWalletProps> = ({
90111
...themeProps
91112
}) => {

packages/thirdweb-react/src/components/Web3Button/index.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,27 @@ interface Web3ButtonProps extends ThemeProviderProps {
2525
isDisabled?: boolean;
2626
}
2727

28+
/**
29+
* A component that allows the user to call an on-chain function on a contract.
30+
*
31+
* The button has to be wrapped in a `ThirdwebProvider` in order to function.
32+
*
33+
* @example
34+
* ```javascript
35+
* import { Web3Button } from '@thirdweb-dev/react';
36+
*
37+
* const App = () => {
38+
* return (
39+
* <div>
40+
* <Web3Button contractAddress="0x..." functionName="mint" />
41+
* </div>
42+
* )
43+
* }
44+
* ```
45+
*
46+
*
47+
* @beta
48+
*/
2849
export const Web3Button: React.FC<PropsWithChildren<Web3ButtonProps>> = ({
2950
contractAddress,
3051
functionName,

0 commit comments

Comments
 (0)