Skip to content

Commit 8b8d479

Browse files
committed
fix hooks code snippets
1 parent 813be05 commit 8b8d479

File tree

10 files changed

+48
-32
lines changed

10 files changed

+48
-32
lines changed

docs/sdk/web/react/hooks/useCheckout.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ function CheckoutButton() {
2121
const { showCheckout, loading, error } = useCheckout();
2222

2323
return (
24-
<button onClick={() => showCheckout()} disabled={loading}>
25-
{loading ? "Opening Checkout..." : "Show Checkout"}
26-
</button>
27-
{error && <div>{error.message}</div>}
24+
<div>
25+
<button onClick={() => showCheckout()} disabled={loading}>
26+
{loading ? "Opening Checkout..." : "Show Checkout"}
27+
</button>
28+
{error && <div>{error.message}</div>}
29+
</div>
2830
);
2931
}
3032
```

docs/sdk/web/react/hooks/useEnableMFA.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ function EnableMFAButton() {
2121
const { enableMFA, loading, error } = useEnableMFA();
2222

2323
return (
24-
<button onClick={() => enableMFA()} disabled={loading}>
25-
{loading ? "Enabling MFA..." : "Enable MFA"}
26-
</button>
27-
{error && <div>{error.message}</div>}
24+
<div>
25+
<button onClick={() => enableMFA()} disabled={loading}>
26+
{loading ? "Enabling MFA..." : "Enable MFA"}
27+
</button>
28+
{error && <div>{error.message}</div>}
29+
</div>
2830
);
2931
}
3032
```

docs/sdk/web/react/hooks/useManageMFA.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ function ManageMFAButton() {
2222
const { manageMFA, loading, error } = useManageMFA();
2323

2424
return (
25-
<button onClick={() => manageMFA()} disabled={loading}>
26-
{loading ? "Managing MFA..." : "Manage MFA"}
27-
</button>
28-
{error && <div>{error.message}</div>}
25+
<div>
26+
<button onClick={() => manageMFA()} disabled={loading}>
27+
{loading ? "Managing MFA..." : "Manage MFA"}
28+
</button>
29+
{error && <div>{error.message}</div>}
30+
</div>
2931
);
3032
}
3133
```

docs/sdk/web/react/hooks/useSwap.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ function SwapButton() {
2121
const { showSwap, loading, error } = useSwap();
2222

2323
return (
24-
<>
24+
<div>
2525
<button onClick={() => showSwap()} disabled={loading}>
2626
{loading ? "Opening Swap..." : "Open Swap"}
2727
</button>
2828
{error && <div>Error: {error.message}</div>}
29-
</>
29+
</div>
3030
);
3131
}
3232
```

docs/sdk/web/react/hooks/useWalletConnectScanner.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ function WalletConnectScannerButton() {
2121
const { showWalletConnectScanner, loading, error } = useWalletConnectScanner();
2222

2323
return (
24-
<button onClick={() => showWalletConnectScanner()} disabled={loading}>
25-
{loading ? "Opening Scanner..." : "Show WalletConnect Scanner"}
26-
</button>
27-
{error && <div>{error.message}</div>}
24+
<div>
25+
<button onClick={() => showWalletConnectScanner()} disabled={loading}>
26+
{loading ? "Opening Scanner..." : "Show WalletConnect Scanner"}
27+
</button>
28+
{error && <div>{error.message}</div>}
29+
</div>
2830
);
2931
}
3032
```

docs/sdk/web/react/hooks/useWalletServicesPlugin.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function WalletServicesExample() {
2323
useWalletServicesPlugin();
2424

2525
return (
26-
<>
26+
<div>
2727
<button onClick={() => showWalletConnectScanner()} disabled={!isPluginConnected}>
2828
Show WalletConnect Scanner
2929
</button>
@@ -33,7 +33,7 @@ function WalletServicesExample() {
3333
<button onClick={() => showWalletUI()} disabled={!isPluginConnected}>
3434
Show Wallet UI
3535
</button>
36-
</>
36+
</div>
3737
);
3838
}
3939
```

docs/sdk/web/react/hooks/useWalletUI.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ function WalletUIButton() {
2121
const { showWalletUI, loading, error } = useWalletUI();
2222

2323
return (
24-
<button onClick={() => showWalletUI()} disabled={loading}>
25-
{loading ? "Opening Wallet UI..." : "Show Wallet UI"}
26-
</button>
27-
{error && <div>{error.message}</div>}
24+
<div>
25+
<button onClick={() => showWalletUI()} disabled={loading}>
26+
{loading ? "Opening Wallet UI..." : "Show Wallet UI"}
27+
</button>
28+
{error && <div>{error.message}</div>}
29+
</div>
2830
);
2931
}
3032
```

docs/sdk/web/react/hooks/useWeb3AuthConnect.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ function ConnectButton() {
6060
const { connect, loading, isConnected, error } = useWeb3AuthConnect();
6161

6262
return (
63-
<button onClick={() => connect()} disabled={loading || isConnected}>
64-
{loading ? "Connecting..." : isConnected ? "Connected" : "Connect"}
65-
</button>
66-
{error && <div>{error.message}</div>}
63+
<div>
64+
<button onClick={() => connect()} disabled={loading || isConnected}>
65+
{loading ? "Connecting..." : isConnected ? "Connected" : "Connect"}
66+
</button>
67+
{error && <div>{error.message}</div>}
68+
</div>
6769
);
6870
}
6971
```

docs/sdk/web/react/hooks/useWeb3AuthDisconnect.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ function DisconnectButton() {
2121
const { disconnect, loading, error } = useWeb3AuthDisconnect();
2222

2323
return (
24-
<button onClick={() => disconnect()} disabled={loading}>
25-
{loading ? "Disconnecting..." : "Disconnect"}
26-
</button>
27-
{error && <div>{error.message}</div>}
24+
<div>
25+
<button onClick={() => disconnect()} disabled={loading}>
26+
{loading ? "Disconnecting..." : "Disconnect"}
27+
</button>
28+
{error && <div>{error.message}</div>}
29+
</div>
2830
);
2931
}
3032
```

docs/sdk/web/react/hooks/useWeb3AuthUser.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ function UserInfo() {
2525
if (!userInfo) return <div>No user info available.</div>;
2626

2727
return (
28+
<>
2829
<div>
2930
<pre>{JSON.stringify(userInfo, null, 2)}</pre>
3031
<div>MFA Enabled: {isMFAEnabled ? "Yes" : "No"}</div>
3132
<button onClick={() => getUserInfo()}>Refresh User Info</button>
3233
</div>
3334
{error && <div>{error.message}</div>}
35+
</>
3436
);
3537
}
3638
```

0 commit comments

Comments
 (0)