Skip to content

Commit d73aa0b

Browse files
committed
fix: change proxy info
1 parent 43a7d14 commit d73aa0b

File tree

4 files changed

+43
-33
lines changed

4 files changed

+43
-33
lines changed

src/components/CopyProxyInfo/index.tsx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ import { useState } from 'react';
22
import Skeleton from '../Skeleton';
33

44
import { ReactComponent as ChevronArrow } from "./assets/right-chevron.svg";
5+
import { PROXY_PAC, PROXY_PORT, PROXY_SERVER } from '../../utils/constants';
56

67
type CopyProxyInfoProps = {
78

89
}
910

10-
export default function CopyProxyInfo({}: CopyProxyInfoProps) {
11+
export default function CopyProxyInfo({ }: CopyProxyInfoProps) {
1112
const [isOpen, setIsOpen] = useState<boolean>(false);
1213
const [isProxyServerCopied, setIsProxyServerCopied] = useState<boolean>(false);
1314
const [isProxyPortCopied, setIsProxyPortCopied] = useState<boolean>(false);
1415
const [isPACCopied, setIsPACCopied] = useState<boolean>(false);
1516

16-
const handleCopy = (text:string, setMethod: (val: boolean) => any) => {
17+
const handleCopy = (text: string, setMethod: (val: boolean) => any) => {
1718
navigator.clipboard.writeText(text);
1819

1920
setMethod(true);
@@ -34,8 +35,8 @@ export default function CopyProxyInfo({}: CopyProxyInfoProps) {
3435
<p>Proxy server:</p>
3536
{
3637
true ? (
37-
<button onClick={() => handleCopy("127.0.0.1", setIsProxyServerCopied)}>
38-
<p>127.0.0.1</p>
38+
<button onClick={() => handleCopy(PROXY_SERVER, setIsProxyServerCopied)}>
39+
<p>{PROXY_SERVER}</p>
3940
{
4041
isProxyServerCopied ? (
4142
<img src="/assets/check.svg" alt="Copy icon" />
@@ -54,8 +55,8 @@ export default function CopyProxyInfo({}: CopyProxyInfoProps) {
5455
<p>Proxy port:</p>
5556
{
5657
true ? (
57-
<button onClick={() => handleCopy("8888", setIsProxyPortCopied)}>
58-
<p>8888</p>
58+
<button onClick={() => handleCopy(PROXY_PORT, setIsProxyPortCopied)}>
59+
<p>{PROXY_PORT}</p>
5960
{
6061
isProxyPortCopied ? (
6162
<img src="/assets/check.svg" alt="Copy icon" />
@@ -72,23 +73,23 @@ export default function CopyProxyInfo({}: CopyProxyInfoProps) {
7273

7374
<div className="wallet-info">
7475
<p>PAC:</p>
75-
{
76-
true ? (
77-
<button onClick={() => handleCopy("http://127.0.0.1:8888/pac", setIsPACCopied)}>
78-
<p>http://127.0.0.1:8888/pac</p>
79-
{
80-
isPACCopied ? (
81-
<img src="/assets/check.svg" alt="Copy icon" />
82-
) : (
83-
<img src="/assets/copy-purple.svg" alt="Copy icon" />
84-
)
85-
}
86-
</button>
87-
) : (
88-
<Skeleton width="100px" height="24px" />
89-
)
90-
}
91-
</div>
76+
{
77+
true ? (
78+
<button onClick={() => handleCopy(PROXY_PAC, setIsPACCopied)}>
79+
<p>{PROXY_PAC}</p>
80+
{
81+
isPACCopied ? (
82+
<img src="/assets/check.svg" alt="Copy icon" />
83+
) : (
84+
<img src="/assets/copy-purple.svg" alt="Copy icon" />
85+
)
86+
}
87+
</button>
88+
) : (
89+
<Skeleton width="100px" height="24px" />
90+
)
91+
}
92+
</div>
9293
</div>
9394
)
9495
}

src/components/ProxyInfo/index.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import Separator from '../Separator';
66
import Skeleton from '../Skeleton';
77

88
import './index.css';
9+
import { PROXY_PAC, PROXY_PORT, PROXY_SERVER } from '../../utils/constants';
910

1011
export default function ProxyInfo() {
1112
const [isDropdownOpen, setIsDropdownOpen] = useState<boolean>(false);
1213
const [isProxyServerCopied, setIsProxyServerCopied] = useState<boolean>(false);
1314
const [isProxyPortCopied, setIsProxyPortCopied] = useState<boolean>(false);
1415
const [isPACCopied, setIsPACCopied] = useState<boolean>(false);
1516

16-
const handleCopy = (text:string, setMethod: (val: boolean) => any) => {
17+
const handleCopy = (text: string, setMethod: (val: boolean) => any) => {
1718
navigator.clipboard.writeText(text);
1819

1920
setMethod(true);
@@ -32,8 +33,8 @@ export default function ProxyInfo() {
3233
<ClickableItem title="Proxy server:" chevron={false}>
3334
{
3435
true ? (
35-
<button onClick={() => handleCopy("127.0.0.1", setIsProxyServerCopied)}>
36-
<p>127.0.0.1</p>
36+
<button onClick={() => handleCopy(PROXY_SERVER, setIsProxyServerCopied)}>
37+
<p>{PROXY_SERVER}</p>
3738
{
3839
isProxyServerCopied ? (
3940
<img src="/assets/check.svg" alt="Copy icon" />
@@ -51,8 +52,8 @@ export default function ProxyInfo() {
5152
<ClickableItem title="Proxy Port:" chevron={false}>
5253
{
5354
true ? (
54-
<button onClick={() => handleCopy("8888", setIsProxyPortCopied)}>
55-
<p>8888</p>
55+
<button onClick={() => handleCopy(PROXY_PORT, setIsProxyPortCopied)}>
56+
<p>{PROXY_PORT}</p>
5657
{
5758
isProxyPortCopied ? (
5859
<img src="/assets/check.svg" alt="Copy icon" />
@@ -70,8 +71,8 @@ export default function ProxyInfo() {
7071
<ClickableItem title="PAC:" chevron={false}>
7172
{
7273
true ? (
73-
<button onClick={() => handleCopy("http://127.0.0.1:8888/pac", setIsPACCopied)}>
74-
<p>http://127.0.0.1:8888/pac</p>
74+
<button onClick={() => handleCopy(PROXY_PAC, setIsPACCopied)}>
75+
<p>{PROXY_PAC}</p>
7576
{
7677
isPACCopied ? (
7778
<img src="/assets/check.svg" alt="Copy icon" />

src/pages/FAQ/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import SilentPassServiceTable from "./assets/silent-pass-service-table.svg";
44
import SilentPassBenefitsTable from "./assets/silent-pass-benefits-table.svg";
55

66
import "./index.css";
7+
import { PROXY_PAC, PROXY_PORT, PROXY_SERVER } from '../../utils/constants';
78

89
const FAQ = () => {
910
return (
@@ -80,9 +81,9 @@ const FAQ = () => {
8081
<p>
8182
Support Windows 10~, Linux & MacOS <br />
8283
Local Proxy Auto-Config (PAC) Url: <br />
83-
http://localhost:3002/pac <br />
84-
Proxy server: localhost <br />
85-
Port number: 3002 <br />
84+
{PROXY_PAC} <br />
85+
Proxy server: {PROXY_SERVER} <br />
86+
Port number: {PROXY_PORT} <br />
8687
</p>
8788
</div>
8889
</div>

src/utils/constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const conetProvider = new ethers.JsonRpcProvider(conetRpc);
1717
const ethProvider = new ethers.JsonRpcProvider(ethRpc());
1818
const conetDepinProvider = new ethers.JsonRpcProvider(mainChain_rpc);
1919

20+
const PROXY_SERVER = "127.0.0.1";
21+
const PROXY_PORT = "3002";
22+
const PROXY_PAC = `http://${PROXY_SERVER}:${PROXY_PORT}/pac`;
23+
2024
export {
2125
localDatabaseName,
2226
XMLHttpRequestTimeout,
@@ -26,4 +30,7 @@ export {
2630
conetProvider,
2731
ethProvider,
2832
conetDepinProvider,
33+
PROXY_SERVER,
34+
PROXY_PORT,
35+
PROXY_PAC,
2936
};

0 commit comments

Comments
 (0)