|
|
@@ -67,15 +67,15 @@ import { clusterApiUrl } from '@solana/web3.js';
|
|
|
require('@solana/wallet-adapter-react-ui/styles.css');
|
|
|
|
|
|
export const Wallet: FC = () => {
|
|
|
- // Can be set to 'devnet', 'testnet', or 'mainnet-beta'
|
|
|
+ // The network can be set to 'devnet', 'testnet', or 'mainnet-beta'.
|
|
|
const network = WalletAdapterNetwork.Devnet;
|
|
|
|
|
|
- // You can also provide a custom RPC endpoint
|
|
|
+ // You can also provide a custom RPC endpoint.
|
|
|
const endpoint = useMemo(() => clusterApiUrl(network), [network]);
|
|
|
|
|
|
// @solana/wallet-adapter-wallets includes all the adapters but supports tree shaking and lazy loading --
|
|
|
// Only the wallets you configure here will be compiled into your application, and only the dependencies
|
|
|
- // of wallets that your users connect to will be loaded
|
|
|
+ // of wallets that your users connect to will be loaded.
|
|
|
const wallets = useMemo(
|
|
|
() => [
|
|
|
new PhantomWalletAdapter(),
|
|
|
@@ -95,6 +95,7 @@ export const Wallet: FC = () => {
|
|
|
<WalletModalProvider>
|
|
|
<WalletMultiButton />
|
|
|
<WalletDisconnectButton />
|
|
|
+ { /* Your app's components go here, nested within the context providers. */ }
|
|
|
</WalletModalProvider>
|
|
|
</WalletProvider>
|
|
|
</ConnectionProvider>
|
|
|
@@ -102,25 +103,6 @@ export const Wallet: FC = () => {
|
|
|
};
|
|
|
```
|
|
|
|
|
|
-You can pass in these optional display props to `WalletModalProvider`:
|
|
|
-
|
|
|
-| prop | type | default | description |
|
|
|
-| --------------- | ----------- | ----------- | ------------------------------------------------------------- |
|
|
|
-| className | `string` | `""` | additional modal class name |
|
|
|
-| logo | `ReactNode` | `undefined` | your logo url or image element |
|
|
|
-| featuredWallets | `number` | `3` | initial number of wallets to display in the modal |
|
|
|
-| container | `string` | `"body"` | CSS selector for the container element to append the modal to |
|
|
|
-
|
|
|
-For example, to show your logo:
|
|
|
-
|
|
|
-```tsx
|
|
|
-<WalletModalProvider logo="YOUR_LOGO_URL">...</WalletModalProvider>
|
|
|
-```
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-_Modal logo example_
|
|
|
-
|
|
|
### Usage
|
|
|
|
|
|
```tsx
|