Skip to content

Commit

Permalink
fix imports, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Jan 24, 2025
1 parent ca41745 commit bb6562d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 80 deletions.
24 changes: 12 additions & 12 deletions playground/nextjs-app-router/onchainkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,22 @@
"default": "./esm/identity/index.js"
},
"./nft": {
"types": "./esm/ui/react/nft/index.d.ts",
"module": "./esm/ui/react/nft/index.js",
"import": "./esm/ui/react/nft/index.js",
"default": "./esm/ui/react/nft/index.js"
"types": "./esm/nft/index.d.ts",
"module": "./esm/nft/index.js",
"import": "./esm/nft/index.js",
"default": "./esm/nft/index.js"
},
"./nft/view": {
"types": "./esm/ui/react/nft/view/index.d.ts",
"module": "./esm/ui/react/nft/view/index.js",
"import": "./esm/ui/react/nft/view/index.js",
"default": "./esm/ui/react/nft/view/index.js"
"types": "./esm/nft/components/view/index.d.ts",
"module": "./esm/nft/components/view/index.js",
"import": "./esm/nft/components/view/index.js",
"default": "./esm/nft/components/view/index.js"
},
"./nft/mint": {
"types": "./esm/ui/react/nft/mint/index.d.ts",
"module": "./esm/ui/react/nft/mint/index.js",
"import": "./esm/ui/react/nft/mint/index.js",
"default": "./esm/ui/react/nft/mint/index.js"
"types": "./esm/nft/components/mint/index.d.ts",
"module": "./esm/nft/components/mint/index.js",
"import": "./esm/nft/components/mint/index.js",
"default": "./esm/nft/components/mint/index.js"
},
"./send": {
"types": "./esm/send/index.d.ts",
Expand Down
56 changes: 0 additions & 56 deletions src/core-react/internal/hooks/useExchangeRate.tsx

This file was deleted.

10 changes: 5 additions & 5 deletions src/internal/components/AmountInput/AmountInput.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { isValidAmount } from '@/core/utils/isValidAmount';
import { CurrencyLabel } from '@/internal/components/AmountInput/CurrencyLabel';
import { TextInput } from '@/internal/components/TextInput';
import { useCallback, useEffect, useRef } from 'react';
import { useAmountInput } from '@/internal/hooks/useAmountInput';
import { useInputResize } from '@/internal/hooks/useInputResize';
import { isValidAmount } from '@/internal/utils/isValidAmount';
import { cn, text } from '@/styles/theme';
import { useAmountInput } from '@/core-react/internal/hooks/useAmountInput';
import { useInputResize } from '@/core-react/wallet/hooks/useInputResize';
import { CurrencyLabel } from '@/internal/components/AmountInput/CurrencyLabel';
import { useCallback, useEffect, useRef } from 'react';

type AmountInputProps = {
asset: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatFiatAmount } from '@/core/utils/formatFiatAmount';
import { formatFiatAmount } from '@/internal/utils/formatFiatAmount';
import { useCallback, useMemo } from 'react';
import { useIcon } from '@/core-react/internal/hooks/useIcon';
import { Skeleton } from '@/internal/components/Skeleton';
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useLifecycleStatus } from '@/core-react/internal/hooks/useLifecycleStat
import type { Token } from '@/token';
import { useWalletContext } from '@/wallet/components/WalletProvider';
import { useWalletAdvancedContext } from '@/wallet/components/WalletAdvancedProvider';
import { useExchangeRate } from '@/core-react/internal/hooks/useExchangeRate';
import { useExchangeRate } from '@/internal/hooks/useExchangeRate';

type SendContextType = {
lifecycleStatus: LifecycleStatus;
Expand Down
14 changes: 9 additions & 5 deletions src/wallet/components/WalletAdvancedTransactionActions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,20 @@ describe('WalletAdvancedTransactionActons', () => {
expect(window.open).not.toHaveBeenCalled();
});

it('opens the send page when the send button is clicked', () => {
it('sets showSend to true when the send button is clicked', () => {
const setShowSendMock = vi.fn();

mockUseWalletAdvancedContext.mockReturnValue({
...defaultMockUseWalletAdvancedContext,
setShowSend: setShowSendMock,
});

render(<WalletAdvancedTransactionActions />);

const sendButton = screen.getByRole('button', { name: 'Send' });
fireEvent.click(sendButton);

expect(window.open).toHaveBeenCalledWith(
'https://wallet.coinbase.com',
'_blank',
);
expect(setShowSendMock).toHaveBeenCalledWith(true);
});

it('sets showSwap to true when the swap button is clicked', () => {
Expand Down

0 comments on commit bb6562d

Please sign in to comment.