Skip to content

Commit dba03ae

Browse files
committed
fix: fixed lint
1 parent 63ebfdd commit dba03ae

2 files changed

Lines changed: 376 additions & 377 deletions

File tree

src/components/WalletButton.tsx

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
import { useState } from "react";
21
import {
3-
Button,
4-
Text,
5-
Modal,
6-
Profile,
7-
Icon,
8-
Tooltip,
9-
} from "@stellar/design-system";
10-
import { useWallet } from "../hooks/useWallet";
11-
import { connectWallet, disconnectWallet } from "../util/wallet";
2+
Button,
3+
Text,
4+
Modal,
5+
Profile,
6+
Icon,
7+
Tooltip,
8+
} from "@stellar/design-system"
9+
import { useState } from "react"
10+
import { useWallet } from "../hooks/useWallet"
11+
import { connectWallet, disconnectWallet } from "../util/wallet"
1212

1313
export const WalletButton = () => {
14-
const [showDisconnectModal, setShowDisconnectModal] = useState(false);
15-
const [isWarningTooltipVisible, setIsWarningTooltipVisible] = useState(false);
16-
const { address, isPending, balances, walletWarnings } = useWallet();
17-
const buttonLabel = isPending ? "Loading..." : "Connect";
14+
const [showDisconnectModal, setShowDisconnectModal] = useState(false)
15+
const [isWarningTooltipVisible, setIsWarningTooltipVisible] = useState(false)
16+
const { address, isPending, balances, walletWarnings } = useWallet()
17+
const buttonLabel = isPending ? "Loading..." : "Connect"
1818

19-
// Build warning message based on wallet issues
20-
const getWarningMessage = () => {
21-
const warnings: string[] = [];
22-
if (walletWarnings.popupAlways) {
23-
warnings.push("This wallet triggers a popup on every interaction");
24-
}
25-
if (walletWarnings.noGetNetworkSupport) {
26-
warnings.push("This wallet doesn't support network detection");
27-
}
28-
return warnings.join(". ");
29-
};
19+
// Build warning message based on wallet issues
20+
const getWarningMessage = () => {
21+
const warnings: string[] = []
22+
if (walletWarnings.popupAlways) {
23+
warnings.push("This wallet triggers a popup on every interaction")
24+
}
25+
if (walletWarnings.noGetNetworkSupport) {
26+
warnings.push("This wallet doesn't support network detection")
27+
}
28+
return warnings.join(". ")
29+
}
3030

31-
// Handle click on warning icon - open help URL if available
32-
const handleWarningClick = () => {
33-
if (walletWarnings.helpUrl) {
34-
window.open(walletWarnings.helpUrl, "_blank", "noopener,noreferrer");
35-
}
36-
};
31+
// Handle click on warning icon - open help URL if available
32+
const handleWarningClick = () => {
33+
if (walletWarnings.helpUrl) {
34+
window.open(walletWarnings.helpUrl, "_blank", "noopener,noreferrer")
35+
}
36+
}
3737

38-
if (!address) {
39-
return (
40-
<Button variant="primary" size="md" onClick={() => void connectWallet()}>
41-
{buttonLabel}
42-
</Button>
43-
);
44-
}
38+
if (!address) {
39+
return (
40+
<Button variant="primary" size="md" onClick={() => void connectWallet()}>
41+
{buttonLabel}
42+
</Button>
43+
)
44+
}
4545

4646
return (
4747
<div
@@ -93,61 +93,61 @@ export const WalletButton = () => {
9393
</Modal>
9494
</div>
9595

96-
<div style={{ position: "relative" }}>
97-
<Profile
98-
publicAddress={address}
99-
size="md"
100-
isShort
101-
onClick={() => setShowDisconnectModal(true)}
102-
/>
96+
<div style={{ position: "relative" }}>
97+
<Profile
98+
publicAddress={address}
99+
size="md"
100+
isShort
101+
onClick={() => setShowDisconnectModal(true)}
102+
/>
103103

104-
{walletWarnings.hasWarnings && (
105-
<div
106-
onMouseEnter={() => setIsWarningTooltipVisible(true)}
107-
onMouseLeave={() => setIsWarningTooltipVisible(false)}
108-
style={{
109-
position: "absolute",
110-
top: "-6px",
111-
right: "-6px",
112-
zIndex: 1,
113-
}}
114-
>
115-
<Tooltip
116-
isVisible={isWarningTooltipVisible}
117-
isContrast
118-
placement="bottom"
119-
triggerEl={
120-
<div
121-
onClick={handleWarningClick}
122-
style={{
123-
display: "flex",
124-
alignItems: "center",
125-
justifyContent: "center",
126-
cursor: "pointer",
127-
backgroundColor: "var(--color-gray-00, #fff)",
128-
borderRadius: "50%",
129-
padding: "3px",
130-
border: "2px solid var(--color-yellow-60, #f0ad4e)",
131-
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
132-
}}
133-
>
134-
<Icon.AlertTriangle
135-
style={{
136-
color: "var(--color-yellow-60, #f0ad4e)",
137-
width: "12px",
138-
height: "12px",
139-
}}
140-
/>
141-
</div>
142-
}
143-
>
144-
<div style={{ maxWidth: "15em" }}>
145-
{getWarningMessage()}. Click to learn more about this issue.
146-
</div>
147-
</Tooltip>
148-
</div>
149-
)}
150-
</div>
151-
</div>
152-
);
153-
};
104+
{walletWarnings.hasWarnings && (
105+
<div
106+
onMouseEnter={() => setIsWarningTooltipVisible(true)}
107+
onMouseLeave={() => setIsWarningTooltipVisible(false)}
108+
style={{
109+
position: "absolute",
110+
top: "-6px",
111+
right: "-6px",
112+
zIndex: 1,
113+
}}
114+
>
115+
<Tooltip
116+
isVisible={isWarningTooltipVisible}
117+
isContrast
118+
placement="bottom"
119+
triggerEl={
120+
<div
121+
onClick={handleWarningClick}
122+
style={{
123+
display: "flex",
124+
alignItems: "center",
125+
justifyContent: "center",
126+
cursor: "pointer",
127+
backgroundColor: "var(--color-gray-00, #fff)",
128+
borderRadius: "50%",
129+
padding: "3px",
130+
border: "2px solid var(--color-yellow-60, #f0ad4e)",
131+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
132+
}}
133+
>
134+
<Icon.AlertTriangle
135+
style={{
136+
color: "var(--color-yellow-60, #f0ad4e)",
137+
width: "12px",
138+
height: "12px",
139+
}}
140+
/>
141+
</div>
142+
}
143+
>
144+
<div style={{ maxWidth: "15em" }}>
145+
{getWarningMessage()}. Click to learn more about this issue.
146+
</div>
147+
</Tooltip>
148+
</div>
149+
)}
150+
</div>
151+
</div>
152+
)
153+
}

0 commit comments

Comments
 (0)