Skip to content

Commit 33722c4

Browse files
authored
Merge pull request #6 from tact-lang/prettier_fixes
2 parents aacda5e + a3c424d commit 33722c4

26 files changed

+30166
-19312
lines changed

src/components/NetworkSwitcher.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
.network-button.active {
2929
color: var(--color-text);
3030
background-color: var(--color-surface);
31-
}
31+
}

src/components/Swap.css

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
padding: 1.5rem;
55
background: #181a20;
66
border-radius: 1.5rem;
7-
box-shadow: 0 4px 24px rgba(0,0,0,0.2);
7+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
88
color: #fff;
99
display: flex;
1010
flex-direction: column;
@@ -69,8 +69,6 @@
6969
color: #555;
7070
}
7171

72-
73-
7472
.amount-setter {
7573
display: flex;
7674
justify-content: flex-end;
@@ -113,8 +111,11 @@
113111
color: #00aaff;
114112
cursor: pointer;
115113
margin: 0.25rem 0;
116-
transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
117-
box-shadow: 0 2px 8px rgba(0,170,255,0.04);
114+
transition:
115+
background 0.2s ease,
116+
border-color 0.2s ease,
117+
box-shadow 0.2s ease;
118+
box-shadow: 0 2px 8px rgba(0, 170, 255, 0.04);
118119
display: flex;
119120
align-items: center;
120121
justify-content: center;
@@ -123,7 +124,7 @@
123124
.swap-direction:hover {
124125
background: #00aaff22;
125126
border-color: #00aaff;
126-
box-shadow: 0 4px 16px rgba(0,170,255,0.15);
127+
box-shadow: 0 4px 16px rgba(0, 170, 255, 0.15);
127128
}
128129

129130
.swap-direction:active {
@@ -194,15 +195,18 @@
194195
display: flex;
195196
align-items: center;
196197
justify-content: space-between;
197-
transition: background 0.2s, box-shadow 0.2s;
198-
box-shadow: 0 2px 8px rgba(0,170,255,0.04);
198+
transition:
199+
background 0.2s,
200+
box-shadow 0.2s;
201+
box-shadow: 0 2px 8px rgba(0, 170, 255, 0.04);
199202
height: 3rem;
200203
box-sizing: border-box;
201204
}
202-
.tact-dropdown-btn:focus, .tact-dropdown-btn:hover {
205+
.tact-dropdown-btn:focus,
206+
.tact-dropdown-btn:hover {
203207
background: #1a2233;
204208
color: #00aaff;
205-
box-shadow: 0 4px 16px rgba(0,170,255,0.10);
209+
box-shadow: 0 4px 16px rgba(0, 170, 255, 0.1);
206210
}
207211

208212
.tact-dropdown-menu {
@@ -212,7 +216,7 @@
212216
width: 100%;
213217
background: #23262f;
214218
border-radius: 12px;
215-
box-shadow: 0 4px 16px rgba(0,170,255,0.10);
219+
box-shadow: 0 4px 16px rgba(0, 170, 255, 0.1);
216220
z-index: 10;
217221
overflow: hidden;
218222
border: 1px solid #00aaff33;
@@ -223,10 +227,13 @@
223227
cursor: pointer;
224228
color: #fff;
225229
font-size: 1.05rem;
226-
transition: background 0.15s, color 0.15s;
230+
transition:
231+
background 0.15s,
232+
color 0.15s;
227233
background: none;
228234
}
229-
.tact-dropdown-item:hover, .tact-dropdown-item:focus {
235+
.tact-dropdown-item:hover,
236+
.tact-dropdown-item:focus {
230237
background: #00aaff22 !important;
231238
color: #00aaff !important;
232239
}
@@ -237,23 +244,25 @@
237244
}
238245

239246
/* Custom input for jetton address */
240-
.swap-section input[type="text"] {
247+
.swap-section input[type='text'] {
241248
background: #181a20;
242249
border: 1px solid #00aaff33;
243250
color: #fff;
244251
border-radius: 12px;
245252
padding: 0.75rem;
246253
font-size: 1.1rem;
247-
transition: border 0.2s, box-shadow 0.2s;
254+
transition:
255+
border 0.2s,
256+
box-shadow 0.2s;
248257
}
249-
.swap-section input[type="text"]:focus {
258+
.swap-section input[type='text']:focus {
250259
border: 1.5px solid #00aaff;
251260
box-shadow: 0 0 0 2px #00aaff33;
252261
outline: none;
253262
}
254263

255264
/* Make address input same size as dropdown */
256-
.tact-dropdown + input[type="text"] {
265+
.tact-dropdown + input[type='text'] {
257266
width: 180px;
258267
background: #23262f;
259268
border-radius: 12px;
@@ -262,11 +271,13 @@
262271
border: none;
263272
color: #fff;
264273
margin-top: 0.5rem;
265-
transition: box-shadow 0.2s, border 0.2s;
266-
box-shadow: 0 2px 8px rgba(0,170,255,0.04);
274+
transition:
275+
box-shadow 0.2s,
276+
border 0.2s;
277+
box-shadow: 0 2px 8px rgba(0, 170, 255, 0.04);
267278
}
268-
.tact-dropdown + input[type="text"]:focus {
269-
box-shadow: 0 4px 16px rgba(0,170,255,0.10);
279+
.tact-dropdown + input[type='text']:focus {
280+
box-shadow: 0 4px 16px rgba(0, 170, 255, 0.1);
270281
border: 1.5px solid #00aaff;
271282
background: #1a2233;
272-
}
283+
}

src/components/SwapProgress.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@
131131
}
132132

133133
@keyframes pulse {
134-
0%, 100% {
134+
0%,
135+
100% {
135136
opacity: 1;
136137
}
137138
50% {
@@ -187,4 +188,4 @@
187188
background: #2d3748;
188189
cursor: not-allowed;
189190
opacity: 0.6;
190-
}
191+
}

src/components/SwapProgress.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,57 +35,57 @@ const SwapProgress: React.FC<SwapProgressProps> = ({
3535
return '✗'
3636
case 'loading':
3737
return (
38-
<div className="spinner">
39-
<div className="spinner-ring"></div>
38+
<div className='spinner'>
39+
<div className='spinner-ring'></div>
4040
</div>
4141
)
4242
default:
43-
return SWAP_STEPS.findIndex(step => step.id === stepId) + 1
43+
return SWAP_STEPS.findIndex((step) => step.id === stepId) + 1
4444
}
4545
}
4646

47-
const isCompleted = SWAP_STEPS.every(step => stepStatuses[step.id] === 'success')
48-
const hasError = SWAP_STEPS.some(step => stepStatuses[step.id] === 'error')
47+
const isCompleted = SWAP_STEPS.every((step) => stepStatuses[step.id] === 'success')
48+
const hasError = SWAP_STEPS.some((step) => stepStatuses[step.id] === 'error')
4949

5050
return (
51-
<div className="swap-progress-overlay">
52-
<div className="swap-progress-modal">
53-
<div className="swap-progress-header">
54-
<h3 className="swap-progress-title">
51+
<div className='swap-progress-overlay'>
52+
<div className='swap-progress-modal'>
53+
<div className='swap-progress-header'>
54+
<h3 className='swap-progress-title'>
5555
{isCompleted ? 'Swap Completed!' : hasError ? 'Swap Failed' : 'Processing Swap'}
5656
</h3>
5757
{fromTokenSymbol && toTokenSymbol && (fromAmount || toAmount) && (
58-
<p className="swap-progress-subtitle">
58+
<p className='swap-progress-subtitle'>
5959
{fromAmount && toAmount ? (
60-
<>Swap {fromAmount} {fromTokenSymbol} to {toAmount} {toTokenSymbol}</>
60+
<>
61+
Swap {fromAmount} {fromTokenSymbol} to {toAmount} {toTokenSymbol}
62+
</>
6163
) : (
62-
<>Swap {amount} {fromTokenSymbol} to {toTokenSymbol}</>
64+
<>
65+
Swap {amount} {fromTokenSymbol} to {toTokenSymbol}
66+
</>
6367
)}
6468
</p>
6569
)}
6670
</div>
6771

68-
<div className="swap-progress-steps">
72+
<div className='swap-progress-steps'>
6973
{SWAP_STEPS.map((step) => {
7074
const status = stepStatuses[step.id]
7175
return (
7276
<div
7377
key={step.id}
7478
className={`swap-progress-step ${status}`}
7579
>
76-
<div className="swap-progress-step-icon">
77-
{getStepIcon(step.id, status)}
78-
</div>
79-
<div className="swap-progress-step-label">
80-
{step.label}
81-
</div>
80+
<div className='swap-progress-step-icon'>{getStepIcon(step.id, status)}</div>
81+
<div className='swap-progress-step-label'>{step.label}</div>
8282
</div>
8383
)
8484
})}
8585
</div>
8686

8787
<button
88-
className="swap-progress-close"
88+
className='swap-progress-close'
8989
onClick={onClose}
9090
disabled={!isCompleted && !hasError}
9191
>
@@ -96,4 +96,4 @@ const SwapProgress: React.FC<SwapProgressProps> = ({
9696
)
9797
}
9898

99-
export default SwapProgress
99+
export default SwapProgress

src/components/TokenSelector.tsx

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ export default function TokenSelector({
8080
setMode(value)
8181
setOpen(false)
8282
if (value === 'ton') {
83-
setCustomAddress('');
84-
setHasTyped(false);
83+
setCustomAddress('')
84+
setHasTyped(false)
8585
const ton = tokens.find((t) => t.type === 'ton')
8686
if (ton) onSelect(ton)
8787
} else {
88-
setCustomAddress('');
89-
setHasTyped(false);
88+
setCustomAddress('')
89+
setHasTyped(false)
9090
onSelect({
9191
type: 'jetton',
9292
symbol: 'JETTON',
@@ -100,12 +100,19 @@ export default function TokenSelector({
100100
}
101101

102102
const showPreview =
103-
mode === 'ton' || (mode === 'jetton' && selected && selected.type === 'jetton' && selected.address && selected.symbol && selected.logo && hasTyped);
103+
mode === 'ton' ||
104+
(mode === 'jetton' &&
105+
selected &&
106+
selected.type === 'jetton' &&
107+
selected.address &&
108+
selected.symbol &&
109+
selected.logo &&
110+
hasTyped)
104111

105112
const handleCustomAddressChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
106-
const addr = e.target.value;
107-
setCustomAddress(addr);
108-
setHasTyped(true);
113+
const addr = e.target.value
114+
setCustomAddress(addr)
115+
setHasTyped(true)
109116
onSelect({
110117
type: 'jetton',
111118
symbol: 'JETTON',
@@ -114,9 +121,9 @@ export default function TokenSelector({
114121
balance: 0n,
115122
address: addr,
116123
vaultAddress: '',
117-
});
124+
})
118125
if (setJettonAddressStatus) {
119-
setJettonAddressStatus(undefined);
126+
setJettonAddressStatus(undefined)
120127
}
121128
try {
122129
await onJettonAddressInput({
@@ -125,14 +132,14 @@ export default function TokenSelector({
125132
network,
126133
setVaultAddress: setVaultAddress,
127134
onSelect,
128-
});
129-
if (setJettonAddressStatus) setJettonAddressStatus('success');
135+
})
136+
if (setJettonAddressStatus) setJettonAddressStatus('success')
130137
} catch (err) {
131-
if (setJettonAddressStatus) setJettonAddressStatus('error');
138+
if (setJettonAddressStatus) setJettonAddressStatus('error')
132139

133-
toast.error(typeof err === 'string' ? err : (err instanceof Error ? err.message : String(err)))
140+
toast.error(typeof err === 'string' ? err : err instanceof Error ? err.message : String(err))
134141
}
135-
};
142+
}
136143

137144
const getLogoSrc = (token: Token) => {
138145
if (token.logo) return token.logo
@@ -142,7 +149,7 @@ export default function TokenSelector({
142149

143150
// Helper to truncate addresses
144151
const truncateAddress = (addr: string) =>
145-
addr.length > 12 ? `${addr.slice(0, 4)}...${addr.slice(-4)}` : addr;
152+
addr.length > 12 ? `${addr.slice(0, 4)}...${addr.slice(-4)}` : addr
146153

147154
return (
148155
<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
@@ -173,7 +180,11 @@ export default function TokenSelector({
173180
>
174181
{showPreview && selected ? (
175182
<div style={{ display: 'flex', alignItems: 'center', gap: 8, flexGrow: 1 }}>
176-
<img src={getLogoSrc(selected)} alt={`${selected.symbol} logo`} style={{ width: 24, height: 24, borderRadius: '50%' }} />
183+
<img
184+
src={getLogoSrc(selected)}
185+
alt={`${selected.symbol} logo`}
186+
style={{ width: 24, height: 24, borderRadius: '50%' }}
187+
/>
177188
<span style={{ fontWeight: 'bold' }}>{selected.name}</span>
178189
</div>
179190
) : (
@@ -235,26 +246,24 @@ export default function TokenSelector({
235246
marginTop: 4,
236247
padding: '0.75rem',
237248
borderRadius: 12,
238-
border:
239-
!hasTyped
240-
? 'none'
241-
: jettonAddressStatus === 'error'
249+
border: !hasTyped
250+
? 'none'
251+
: jettonAddressStatus === 'error'
242252
? '1.5px solid #f85149'
243253
: jettonAddressStatus === 'success'
244-
? '1.5px solid #3fb950'
245-
: 'none',
254+
? '1.5px solid #3fb950'
255+
: 'none',
246256
background: '#23262f',
247257
color: '#fff',
248258
fontSize: '1.1rem',
249259
outline: 'none',
250-
boxShadow:
251-
!hasTyped
252-
? undefined
253-
: jettonAddressStatus === 'error'
260+
boxShadow: !hasTyped
261+
? undefined
262+
: jettonAddressStatus === 'error'
254263
? '0 0 0 2px #f8514933'
255264
: jettonAddressStatus === 'success'
256-
? '0 0 0 2px #3fb95033'
257-
: undefined,
265+
? '0 0 0 2px #3fb95033'
266+
: undefined,
258267
transition: 'border 0.2s, box-shadow 0.2s',
259268
}}
260269
/>

0 commit comments

Comments
 (0)