diff --git a/src/buy/components/Buy.tsx b/src/buy/components/Buy.tsx index 28f800ee22..693ed6bfdb 100644 --- a/src/buy/components/Buy.tsx +++ b/src/buy/components/Buy.tsx @@ -9,7 +9,7 @@ import { BuyDropdown } from './BuyDropdown'; import { BuyMessage } from './BuyMessage'; import { BuyProvider, useBuyContext } from './BuyProvider'; -export function BuyContent({ className }: { className?: string }) { +function BuyContent({ className }: { className?: string }) { const { isDropdownOpen, setIsDropdownOpen } = useBuyContext(); const buyContainerRef = useRef(null); diff --git a/src/buy/components/BuyAmountInput.tsx b/src/buy/components/BuyAmountInput.tsx index bee2229ba4..e40e820ff0 100644 --- a/src/buy/components/BuyAmountInput.tsx +++ b/src/buy/components/BuyAmountInput.tsx @@ -1,6 +1,6 @@ import { isValidAmount } from '../../core/utils/isValidAmount'; import { TextInput } from '../../internal/components/TextInput'; -import { cn, pressable } from '../../styles/theme'; +import { cn, color } from '../../styles/theme'; import { formatAmount } from '../../swap/utils/formatAmount'; import { TokenChip } from '../../token'; import { useBuyContext } from './BuyProvider'; @@ -28,7 +28,7 @@ export function BuyAmountInput() { inputValidator={isValidAmount} /> diff --git a/src/buy/components/BuyProvider.test.tsx b/src/buy/components/BuyProvider.test.tsx index d2ca0d617d..684996b55b 100644 --- a/src/buy/components/BuyProvider.test.tsx +++ b/src/buy/components/BuyProvider.test.tsx @@ -30,20 +30,20 @@ import { base } from 'wagmi/chains'; import { mock } from 'wagmi/connectors'; import { useSendCalls } from 'wagmi/experimental'; import { useCapabilitiesSafe } from '../../core-react/internal/hooks/useCapabilitiesSafe'; -import { buildSwapTransaction } from '../../core/api/buildSwapTransaction'; import { useOnchainKit } from '../../core-react/useOnchainKit'; -import { getBuyQuote } from '../utils/getBuyQuote'; +import { buildSwapTransaction } from '../../core/api/buildSwapTransaction'; +import type { LifecycleStatus, SwapError, SwapUnit } from '../../swap/types'; +import { getSwapErrorCode } from '../../swap/utils/getSwapErrorCode'; import { daiToken, degenToken, ethToken, usdcToken, } from '../../token/constants'; -import type { LifecycleStatus, SwapError, SwapUnit } from '../../swap/types'; -import { getSwapErrorCode } from '../../swap/utils/getSwapErrorCode'; -import { BuyProvider, useBuyContext } from './BuyProvider'; import { useBuyTokens } from '../hooks/useBuyTokens'; +import { getBuyQuote } from '../utils/getBuyQuote'; import { validateQuote } from '../utils/validateQuote'; +import { BuyProvider, useBuyContext } from './BuyProvider'; const mockResetFunction = vi.fn(); vi.mock('../hooks/useResetBuyInputs', () => ({ diff --git a/src/buy/hooks/useOnrampEventListeners.test.ts b/src/buy/hooks/useOnrampEventListeners.test.ts index a830e8c833..3a890b83dc 100644 --- a/src/buy/hooks/useOnrampEventListeners.test.ts +++ b/src/buy/hooks/useOnrampEventListeners.test.ts @@ -1,4 +1,4 @@ -import { renderHook, act } from '@testing-library/react'; +import { act, renderHook } from '@testing-library/react'; import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest'; import { setupOnrampEventListeners } from '../../fund/utils/setupOnrampEventListeners'; import { useOnrampEventListeners } from './useOnrampEventListeners'; diff --git a/src/buy/hooks/useOnrampEventListeners.ts b/src/buy/hooks/useOnrampEventListeners.ts index 0642cd3c67..5f01541779 100644 --- a/src/buy/hooks/useOnrampEventListeners.ts +++ b/src/buy/hooks/useOnrampEventListeners.ts @@ -1,8 +1,8 @@ import type { EventMetadata } from '@/fund/types'; import type { LifecycleStatus } from '@/swap/types'; -import { useEffect, useCallback } from 'react'; +import { useCallback, useEffect } from 'react'; +import type { TransactionReceipt } from 'viem'; import { setupOnrampEventListeners } from '../../fund/utils/setupOnrampEventListeners'; -import { TransactionReceipt } from 'viem'; type UseOnrampLifecycleParams = { updateLifecycleStatus: (status: LifecycleStatus) => void; @@ -25,7 +25,7 @@ export const useOnrampEventListeners = ({ }); } }, - [updateLifecycleStatus], + [maxSlippage, updateLifecycleStatus], ); const handleOnrampSuccess = useCallback(() => { @@ -37,7 +37,7 @@ export const useOnrampEventListeners = ({ maxSlippage, }, }); - }, [updateLifecycleStatus]); + }, [maxSlippage, updateLifecycleStatus]); const onPopupClose = useCallback(() => { updateLifecycleStatus({ @@ -58,7 +58,7 @@ export const useOnrampEventListeners = ({ return () => { unsubscribe(); }; - }, [setupOnrampEventListeners, handleOnrampEvent, handleOnrampSuccess]); + }, [handleOnrampEvent, handleOnrampSuccess]); return { onPopupClose }; }; diff --git a/src/buy/hooks/usePopupMonitor.test.ts b/src/buy/hooks/usePopupMonitor.test.ts index 371533dcad..71e4feb637 100644 --- a/src/buy/hooks/usePopupMonitor.test.ts +++ b/src/buy/hooks/usePopupMonitor.test.ts @@ -1,6 +1,6 @@ import { renderHook } from '@testing-library/react'; import { act } from 'react'; -import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { usePopupMonitor } from './usePopupMonitor'; describe('usePopupMonitor', () => { diff --git a/src/buy/utils/validateQuote.test.ts b/src/buy/utils/validateQuote.test.ts index 96f1209d1f..206d885c0b 100644 --- a/src/buy/utils/validateQuote.test.ts +++ b/src/buy/utils/validateQuote.test.ts @@ -1,8 +1,8 @@ -import { type Mock, beforeEach, vi, expect, it, describe } from 'vitest'; -import { validateQuote } from './validateQuote'; +import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest'; +import type { GetSwapQuoteResponse } from '../../core/api/types'; +import type { SwapUnit } from '../../swap/types'; import { isSwapError } from '../../swap/utils/isSwapError'; -import { SwapUnit } from '../../swap/types'; -import { GetSwapQuoteResponse } from '../../core/api/types'; +import { validateQuote } from './validateQuote'; vi.mock('../../swap/utils/isSwapError', () => ({ isSwapError: vi.fn(), diff --git a/src/buy/utils/validateQuote.ts b/src/buy/utils/validateQuote.ts index d44808da16..28d6e30c36 100644 --- a/src/buy/utils/validateQuote.ts +++ b/src/buy/utils/validateQuote.ts @@ -1,5 +1,5 @@ import type { GetSwapQuoteResponse } from '@/core/api/types'; -import type { SwapUnit, LifecycleStatusUpdate } from '@/swap/types'; +import type { LifecycleStatusUpdate, SwapUnit } from '@/swap/types'; import { isSwapError } from '../../swap/utils/isSwapError'; type ValidateQuoteParams = {