Skip to content

Commit 263c48e

Browse files
committed
Fix prettier issues
1 parent faa484b commit 263c48e

File tree

5 files changed

+154
-145
lines changed

5 files changed

+154
-145
lines changed

src/components/PregenerateWallet/index.tsx

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,86 @@
1-
import React, { useState, useEffect } from "react";
2-
import useIsBrowser from '@docusaurus/useIsBrowser';
3-
import styles from "./styles.module.css";
1+
import React, { useState, useEffect } from 'react'
2+
import useIsBrowser from '@docusaurus/useIsBrowser'
3+
import styles from './styles.module.css'
44

55
export default function LookupAPIPage() {
6-
const isBrowser = useIsBrowser();
7-
const networkOptions = ["sapphire_mainnet", "sapphire_devnet"];
6+
const isBrowser = useIsBrowser()
7+
const networkOptions = ['sapphire_mainnet', 'sapphire_devnet']
88

99
if (!isBrowser) {
10-
return <div>Loading...</div>;
10+
return <div>Loading...</div>
1111
}
1212

1313
const constructURL = () => {
14-
const baseUrl = "https://lookup.web3auth.io/lookup";
15-
const queryParams = new URLSearchParams(formData);
14+
const baseUrl = 'https://lookup.web3auth.io/lookup'
15+
const queryParams = new URLSearchParams(formData)
1616

17-
const readableParams: React.ReactNode[] = [];
17+
const readableParams: React.ReactNode[] = []
1818
queryParams.forEach((value, key) => {
1919
readableParams.push(
2020
<span key={key}>
2121
<span className={styles.parameterKey}>{key}</span>=
2222
<span className={styles.parameterValue}>{value}</span>&
23-
</span>,
24-
);
25-
});
23+
</span>
24+
)
25+
})
2626

2727
return (
2828
<div className={styles.urlDisplay}>
2929
<span className={styles.getMethod}>GET</span> {baseUrl}?{readableParams}
3030
</div>
31-
);
32-
};
31+
)
32+
}
3333

3434
const [formData, setFormData] = useState({
35-
verifier: "w3a-google-demo",
36-
verifierId: "devrel@web3auth.io",
37-
web3AuthNetwork: "sapphire_mainnet",
35+
verifier: 'w3a-google-demo',
36+
verifierId: 'devrel@web3auth.io',
37+
web3AuthNetwork: 'sapphire_mainnet',
3838
clientId:
39-
"BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ",
40-
});
41-
const [isLoading, setIsLoading] = useState(false);
42-
const [response, setResponse] = useState<string | null>(null);
43-
const [error, setError] = useState("");
39+
'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ',
40+
})
41+
const [isLoading, setIsLoading] = useState(false)
42+
const [response, setResponse] = useState<string | null>(null)
43+
const [error, setError] = useState('')
4444

45-
const handleChange = (e) => {
46-
setFormData({ ...formData, [e.target.name]: e.target.value });
47-
};
45+
const handleChange = e => {
46+
setFormData({ ...formData, [e.target.name]: e.target.value })
47+
}
4848

49-
const handleSubmit = async (e) => {
50-
e.preventDefault();
51-
setIsLoading(true);
52-
setResponse(null);
53-
setError("");
49+
const handleSubmit = async e => {
50+
e.preventDefault()
51+
setIsLoading(true)
52+
setResponse(null)
53+
setError('')
5454

5555
try {
56-
const axios = (await import("axios")).default;
57-
const res = await axios.get(`https://lookup.web3auth.io/lookup`, { params: formData });
58-
setResponse(JSON.stringify(res.data, null, 2));
56+
const axios = (await import('axios')).default
57+
const res = await axios.get(`https://lookup.web3auth.io/lookup`, { params: formData })
58+
setResponse(JSON.stringify(res.data, null, 2))
5959
} catch (err) {
60-
setError(err.message);
60+
setError(err.message)
6161
} finally {
62-
setIsLoading(false);
62+
setIsLoading(false)
6363
}
64-
};
64+
}
6565

6666
useEffect(() => {
67-
if (!isBrowser) return;
67+
if (!isBrowser) return
6868

6969
const fetchInitialData = async () => {
70-
setIsLoading(true);
70+
setIsLoading(true)
7171
try {
72-
const axios = (await import("axios")).default;
73-
const res = await axios.get(`https://lookup.web3auth.io/lookup`, { params: formData });
74-
setResponse(JSON.stringify(res.data, null, 2));
72+
const axios = (await import('axios')).default
73+
const res = await axios.get(`https://lookup.web3auth.io/lookup`, { params: formData })
74+
setResponse(JSON.stringify(res.data, null, 2))
7575
} catch (err) {
76-
setError(err.message);
76+
setError(err.message)
7777
} finally {
78-
setIsLoading(false);
78+
setIsLoading(false)
7979
}
80-
};
80+
}
8181

82-
fetchInitialData();
83-
}, [isBrowser]);
82+
fetchInitialData()
83+
}, [isBrowser])
8484

8585
return (
8686
<>
@@ -103,7 +103,7 @@ export default function LookupAPIPage() {
103103
</td>
104104
<td>
105105
The verifier name can be found on your Web3Auth dashboard. To learn more about
106-
verifiers, click{" "}
106+
verifiers, click{' '}
107107
<a href="/docs/authentication" target="_blank" rel="noopener noreferrer">
108108
here
109109
</a>
@@ -124,7 +124,7 @@ export default function LookupAPIPage() {
124124
<code>verifierId</code>
125125
</td>
126126
<td>
127-
The verifier ID value. One of the ways to get it is via the response to the{" "}
127+
The verifier ID value. One of the ways to get it is via the response to the{' '}
128128
<code>getUserInfo()</code> method.
129129
</td>
130130
<td>
@@ -147,9 +147,8 @@ export default function LookupAPIPage() {
147147
name="web3AuthNetwork"
148148
value={formData.web3AuthNetwork}
149149
onChange={handleChange}
150-
required
151-
>
152-
{networkOptions.map((network) => (
150+
required>
151+
{networkOptions.map(network => (
153152
<option key={network} value={network}>
154153
{network}
155154
</option>
@@ -181,7 +180,7 @@ export default function LookupAPIPage() {
181180
</div>
182181
<div className={styles.submitButtonContainer}>
183182
<button type="submit" className={styles.submitButton} disabled={isLoading}>
184-
{isLoading ? <div className={styles.loader}></div> : "Submit"}
183+
{isLoading ? <div className={styles.loader}></div> : 'Submit'}
185184
</button>
186185
</div>
187186
</form>
@@ -193,5 +192,5 @@ export default function LookupAPIPage() {
193192
{error && <p className={styles.error}>{error}</p>}
194193
</div>
195194
</>
196-
);
195+
)
197196
}

src/components/PregenerateWallet/styles.module.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
}
4242

4343
/* Mobile responsive design */
44-
@media (max-width: 768px) {
44+
@media (width <= 768px) {
4545
.formTable {
4646
display: block;
4747
overflow-x: auto;
@@ -166,7 +166,7 @@
166166
.responseTerminal {
167167
background: var(--ifm-color-emphasis-100);
168168
color: var(--ifm-color-content);
169-
font-family: "SF Mono", "Monaco", "Consolas", "Courier New", monospace;
169+
font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
170170
font-size: 13px;
171171
line-height: 1.4;
172172
padding: 20px;
@@ -186,7 +186,7 @@
186186
border-color: var(--ifm-color-gray-700);
187187
}
188188

189-
@media (max-width: 768px) {
189+
@media (width <= 768px) {
190190
.responseTerminal {
191191
padding: 16px;
192192
font-size: 12px;
@@ -209,7 +209,7 @@
209209
border: 1px solid var(--ifm-color-emphasis-300);
210210
border-left: 4px solid var(--ifm-color-primary);
211211
padding: 16px;
212-
font-family: "SF Mono", "Monaco", "Consolas", "Courier New", monospace;
212+
font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
213213
font-size: 14px;
214214
color: var(--ifm-color-content);
215215
margin-top: 20px;
@@ -219,7 +219,7 @@
219219
word-break: break-all;
220220
}
221221

222-
@media (max-width: 768px) {
222+
@media (width <= 768px) {
223223
.urlDisplay {
224224
font-size: 12px;
225225
padding: 12px;
@@ -259,7 +259,7 @@
259259
margin-top: 20px;
260260
}
261261

262-
@media (max-width: 768px) {
262+
@media (width <= 768px) {
263263
.submitButtonContainer {
264264
margin-top: 16px;
265265
}
@@ -277,7 +277,7 @@
277277
font-weight: bold;
278278
}
279279

280-
@media (max-width: 768px) {
280+
@media (width <= 768px) {
281281
.instructionTextContainer {
282282
margin-top: 16px;
283283
font-size: 14px;

0 commit comments

Comments
 (0)