Skip to content

Commit 440c143

Browse files
committed
nits
1 parent a1fe6a8 commit 440c143

File tree

6 files changed

+38
-28
lines changed

6 files changed

+38
-28
lines changed

other/smart-account-example/src/App.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "./App.css";
2-
import { useWeb3AuthConnect, useWeb3AuthDisconnect, useWeb3AuthUser} from "@web3auth/modal/react";
2+
import { useWeb3AuthConnect, useWeb3AuthDisconnect, useWeb3AuthUser } from "@web3auth/modal/react";
33
import { useAccount } from "wagmi";
44
import { SendUserOperation } from "./components/SendUserOperation";
55
import { Balance } from "./components/Balance";
@@ -9,7 +9,7 @@ function App() {
99
const { disconnect } = useWeb3AuthDisconnect();
1010
const { userInfo } = useWeb3AuthUser();
1111
const { address } = useAccount();
12-
12+
1313
function uiConsole(...args: any[]): void {
1414
const el = document.querySelector("#console>p");
1515
if (el) {
@@ -22,7 +22,7 @@ function App() {
2222
<>
2323
<h2>Connected to {connectorName}</h2>
2424
<div>{address}</div>
25-
<div className="flex-container">
25+
<div className="flex-container">
2626
<div>
2727
<button onClick={() => uiConsole(userInfo)} className="card">
2828
Get User Info
@@ -47,27 +47,27 @@ function App() {
4747

4848
return (
4949
<div className="container">
50-
<h1 className="title">
51-
<a target="_blank" href="https://web3auth.io/docs/sdk/pnp/web/no-modal" rel="noreferrer">
52-
Web3Auth{" "}
53-
</a>
54-
& React No Modal AA Quick Start
55-
</h1>
50+
<h1 className="title">
51+
<a target="_blank" href="https://web3auth.io/docs/sdk/pnp/web/no-modal" rel="noreferrer">
52+
Web3Auth{" "}
53+
</a>
54+
& React No Modal AA Quick Start
55+
</h1>
5656

57-
<div className="grid">{isConnected ? loggedInView : unloggedInView}</div>
58-
<div id="console" style={{ whiteSpace: "pre-line" }}>
59-
<p style={{ whiteSpace: "pre-line" }}></p>
60-
</div>
57+
<div className="grid">{isConnected ? loggedInView : unloggedInView}</div>
58+
<div id="console" style={{ whiteSpace: "pre-line" }}>
59+
<p style={{ whiteSpace: "pre-line" }}></p>
60+
</div>
6161

62-
<footer className="footer">
63-
<a
64-
href="https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-no-modal-sdk/quick-starts/react-hooks-no-modal-quick-start"
65-
target="_blank"
66-
rel="noopener noreferrer"
67-
>
68-
Source code
69-
</a>
70-
</footer>
62+
<footer className="footer">
63+
<a
64+
href="https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-no-modal-sdk/quick-starts/react-hooks-no-modal-quick-start"
65+
target="_blank"
66+
rel="noopener noreferrer"
67+
>
68+
Source code
69+
</a>
70+
</footer>
7171
</div>
7272
);
7373
}

other/smart-account-example/src/provider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const web3AuthOptions: Web3AuthOptions = {
1212
authBuildEnv: "testing",
1313
};
1414

15-
1615
const web3authConfig = {
1716
web3AuthOptions,
1817
};

quick-starts/react-quick-start/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<html lang="en">
33
<head>
44
<script type="module">
5+
// IMP START - Bundler Issues
56
import { Buffer } from "buffer";
67
import process from "process";
78
window.Buffer = Buffer;
89
window.process = process;
10+
// IMP END - Bundler Issues
911
</script>
1012
<meta charset="UTF-8" />
1113
<link rel="icon" type="image/svg+xml" href="/vite.svg" />

quick-starts/react-quick-start/src/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import "./App.css";
22
import { useWeb3AuthConnect, useWeb3AuthDisconnect, useWeb3AuthUser } from "@web3auth/modal/react";
3+
// IMP START - Blockchain Calls
34
import { useAccount } from "wagmi";
45
import { SendTransaction } from "./components/sendTransaction";
56
import { Balance } from "./components/getBalance";
67
import { SwitchChain } from "./components/switchNetwork";
8+
// IMP END - Blockchain Calls
79
function App() {
810
// IMP START - Login
911
const { connect, isConnected, connectorName, loading: connectLoading, error: connectError } = useWeb3AuthConnect();
@@ -12,7 +14,9 @@ function App() {
1214
const { disconnect, loading: disconnectLoading, error: disconnectError } = useWeb3AuthDisconnect();
1315
// IMP END - Logout
1416
const { userInfo } = useWeb3AuthUser();
17+
// IMP START - Blockchain Calls
1518
const { address } = useAccount();
19+
// IMP END - Blockchain Calls
1620

1721
function uiConsole(...args: any[]): void {
1822
const el = document.querySelector("#console>p");
@@ -25,7 +29,9 @@ function App() {
2529
const loggedInView = (
2630
<div className="grid">
2731
<h2>Connected to {connectorName}</h2>
32+
{/* // IMP START - Blockchain Calls */}
2833
<div>{address}</div>
34+
{/* // IMP END - Blockchain Calls */}
2935
<div className="flex-container">
3036
<div>
3137
<button onClick={() => uiConsole(userInfo)} className="card">

quick-starts/react-quick-start/src/main.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,30 @@ import ReactDOM from "react-dom/client";
55
import { Web3AuthProvider } from "@web3auth/modal/react";
66
import web3AuthContextConfig from "./web3authContext";
77
// IMP END - Setup Web3Auth Provider
8+
89
// IMP START - Setup Wagmi Provider
910
import { WagmiProvider } from "@web3auth/modal/react/wagmi";
1011
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
1112
// IMP END - Setup Wagmi Provider
1213

1314
import App from "./App";
1415

16+
// IMP START - Setup Wagmi Provider
1517
const queryClient = new QueryClient();
18+
// IMP END - Setup Wagmi Provider
1619

1720
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
1821
// IMP START - Setup Web3Auth Provider
1922
<Web3AuthProvider config={web3AuthContextConfig}>
2023
{/* // IMP END - Setup Web3Auth Provider */}
21-
{/*// IMP START - Setup Wagmi Provider*/}
24+
{/* // IMP START - Setup Wagmi Provider */}
2225
<QueryClientProvider client={queryClient}>
2326
<WagmiProvider>
2427
<App />
2528
</WagmiProvider>
2629
</QueryClientProvider>
27-
{/*// IMP END - Setup Wagmi Provider*/}
28-
{/*// IMP START - Setup Web3Auth Provider*/}
30+
{/* // IMP END - Setup Wagmi Provider */}
31+
{/* // IMP START - Setup Web3Auth Provider */}
2932
</Web3AuthProvider>
3033
// IMP END - Setup Web3Auth Provider
3134
);

quick-starts/react-quick-start/src/web3authContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { type Web3AuthContextConfig } from "@web3auth/modal/react";
77
const clientId = import.meta.env.VITE_WEB3AUTH_CLIENT_ID || ""; // get from https://dashboard.web3auth.io
88
// IMP END - Dashboard Registration
99

10-
// IMP START - Instantiate SDK
10+
// IMP START - Config
1111
const web3AuthContextConfig: Web3AuthContextConfig = {
1212
web3AuthOptions: {
1313
clientId,
1414
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
1515
authBuildEnv: "testing",
1616
}
1717
};
18-
// IMP END - Instantiate SDK
18+
// IMP END - Config
1919

2020
export default web3AuthContextConfig;

0 commit comments

Comments
 (0)