Skip to content

Commit 6278ae6

Browse files
fix lint
1 parent d5c806f commit 6278ae6

File tree

6 files changed

+16
-42
lines changed

6 files changed

+16
-42
lines changed

playground/nextjs-app-router/components/demo/FundSwap.tsx

-32
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,6 @@ function FundSwapComponent() {
2222
chainId: base.id,
2323
};
2424

25-
const ethToken: Token = {
26-
name: 'ETH',
27-
address: '',
28-
symbol: 'ETH',
29-
decimals: 18,
30-
image:
31-
'https://wallet-api-production.s3.amazonaws.com/uploads/tokens/eth_288.png',
32-
chainId: base.id,
33-
};
34-
35-
const usdcToken: Token = {
36-
name: 'USDC',
37-
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',
38-
symbol: 'USDC',
39-
decimals: 6,
40-
image:
41-
'https://d3r81g40ycuhqg.cloudfront.net/wallet/wais/44/2b/442b80bd16af0c0d9b22e03a16753823fe826e5bfd457292b55fa0ba8c1ba213-ZWUzYjJmZGUtMDYxNy00NDcyLTg0NjQtMWI4OGEwYjBiODE2',
42-
chainId: base.id,
43-
};
44-
45-
const wethToken: Token = {
46-
name: 'Wrapped Ether',
47-
address: '0x4200000000000000000000000000000000000006',
48-
symbol: 'WETH',
49-
decimals: 6,
50-
image:
51-
'https://d3r81g40ycuhqg.cloudfront.net/wallet/wais/47/bc/47bc3593c2dec7c846b66b7ba5f6fa6bd69ec34f8ebb931f2a43072e5aaac7a8-YmUwNmRjZDUtMjczYy00NDFiLWJhZDUtMzgwNjFmYWM0Njkx',
52-
chainId: base.id,
53-
};
54-
55-
const swappableTokens = [degenToken, ethToken, usdcToken, wethToken];
56-
5725
const handleOnStatus = useCallback((lifecycleStatus: LifecycleStatus) => {
5826
console.log('Status:', lifecycleStatus);
5927
}, []);

src/swap/components/FundSwap.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function FundSwapContent({ className }: { className?: string }) {
3131
return (
3232
<div
3333
ref={walletContainerRef}
34-
className={cn('flex items-center gap-4 relative', className)}
34+
className={cn('relative flex items-center gap-4', className)}
3535
>
3636
<FundSwapInput />
3737
<FundSwapButton />

src/swap/components/FundSwapButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function FundSwapButton() {
1717

1818
const handleSubmit = useCallback(() => {
1919
setIsDropdownOpen(true);
20-
}, []);
20+
}, [setIsDropdownOpen]);
2121

2222
return (
2323
<button

src/swap/components/FundSwapDropdown.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TokenImage } from '../../token';
22
import { background, cn, color } from '../../styles/theme';
33
import { useFundSwapContext } from './FundSwapProvider';
4-
import { SwapUnit } from '../types';
4+
import type { SwapUnit } from '../types';
55
import { useCallback } from 'react';
66

77
function TokenItem({ swapUnit }: { swapUnit: SwapUnit }) {
@@ -13,10 +13,10 @@ function TokenItem({ swapUnit }: { swapUnit: SwapUnit }) {
1313

1414
const handleClick = useCallback(() => {
1515
handleSubmit(swapUnit);
16-
}, [handleSubmit]);
16+
}, [handleSubmit, swapUnit]);
1717

1818
return (
19-
<div className="flex gap-2 items-center" onClick={handleClick}>
19+
<div className="flex items-center gap-2" onClick={handleClick}>
2020
<TokenImage token={swapUnit.token} size={36} />
2121
<div className="flex flex-col">
2222
<div>
@@ -38,7 +38,7 @@ export function FundSwapDropdown() {
3838
className={cn(
3939
color.foreground,
4040
background.alternate,
41-
'flex flex-col absolute translate-y-[110%] right-0 bottom-0 gap-4',
41+
'absolute right-0 bottom-0 flex translate-y-[110%] flex-col gap-4',
4242
'rounded p-4',
4343
)}
4444
>

src/swap/components/FundSwapInput.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ export function FundSwapInput() {
2121
}
2222

2323
return (
24-
<div className="flex items-center h-full border rounded-lg px-4">
24+
<div className="flex h-full items-center rounded-lg border px-4">
2525
<TextInput
2626
className={cn(
2727
'mr-2 w-full border-[none] bg-transparent font-display',
2828
'leading-none outline-none',
29-
// hasInsufficientBalance && address ? color.error : color.foreground,
3029
)}
3130
placeholder="0.0"
3231
delayMs={1000}

src/swap/components/FundSwapProvider.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,18 @@ export function FundSwapProvider({
264264
fromUSDC.setLoading(false);
265265
}
266266
},
267-
[to, fromETH, fromUSDC],
267+
[
268+
to,
269+
fromETH,
270+
fromUSDC,
271+
useAggregator,
272+
updateLifecycleStatus,
273+
lifecycleStatus.statusData.maxSlippage,
274+
],
268275
);
269276

270-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: TODO Refactor this component
271277
const handleSubmit = useCallback(
278+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: TODO Refactor this component
272279
async (from: SwapUnit) => {
273280
if (!address || !from.token || !to.token || !from.amount) {
274281
return;

0 commit comments

Comments
 (0)