Skip to content

Commit

Permalink
Organize code
Browse files Browse the repository at this point in the history
  • Loading branch information
rustam-cb committed Dec 18, 2024
1 parent 535b2f3 commit 6b9c6ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion playground/nextjs-app-router/components/Demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useContext, useEffect, useState } from 'react';
import DemoOptions from './DemoOptions';
import CheckoutDemo from './demo/Checkout';
import FundButtonDemo from './demo/FundButton';
import FundCardDemo from './demo/FundCard';
import IdentityDemo from './demo/Identity';
import { IdentityCardDemo } from './demo/IdentityCard';
import NFTCardDemo from './demo/NFTCard';
Expand All @@ -19,7 +20,6 @@ import TransactionDemo from './demo/Transaction';
import TransactionDefaultDemo from './demo/TransactionDefault';
import WalletDemo from './demo/Wallet';
import WalletDefaultDemo from './demo/WalletDefault';
import FundCardDemo from './demo/FundCard';

const activeComponentMapping: Record<OnchainKitComponent, React.FC> = {
[OnchainKitComponent.FundButton]: FundButtonDemo,
Expand Down
6 changes: 3 additions & 3 deletions src/fund/components/FundCard.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import '@testing-library/jest-dom';
import { useDebounce } from '@/core-react/internal/hooks/useDebounce';
import { setOnchainKitConfig } from '@/core/OnchainKitConfig';
import {
act,
Expand All @@ -8,13 +9,12 @@ import {
waitFor,
} from '@testing-library/react';
import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest';
import { useFundCardFundingUrl } from '../hooks/useFundCardFundingUrl';
import type { FundCardPropsReact } from '../types';
import { fetchOnrampQuote } from '../utils/fetchOnrampQuote';
import { getFundingPopupSize } from '../utils/getFundingPopupSize';
import { FundCard } from './FundCard';
import { FundCardProvider } from './FundCardProvider';
import { useFundCardFundingUrl } from '../hooks/useFundCardFundingUrl';
import { useDebounce } from '@/core-react/internal/hooks/useDebounce';
import { fetchOnrampQuote } from '../utils/fetchOnrampQuote';

vi.mock('../../core-react/internal/hooks/useTheme', () => ({
useTheme: () => 'mocked-theme-class',
Expand Down
6 changes: 2 additions & 4 deletions src/fund/hooks/useFundCardFundingUrl.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { setOnchainKitConfig } from '@/core/OnchainKitConfig';
import { useOnchainKit } from '@/core-react/useOnchainKit';
import { renderHook } from '@testing-library/react';
import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest';
import { useAccount } from 'wagmi';
import { useFundContext } from '../components/FundCardProvider';
import { useExchangeRate } from './useExchangeRate';
import { useFundCardFundingUrl } from './useFundCardFundingUrl';
import { useOnchainKit } from '@/core-react/useOnchainKit';
import { useAccount } from 'wagmi';

vi.mock('../components/FundCardProvider', () => ({
useFundContext: vi.fn(),
Expand Down
4 changes: 2 additions & 2 deletions src/fund/hooks/useFundCardFundingUrl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from 'react';
import { useFundContext } from '../components/FundCardProvider';
import { useOnchainKit } from '@/core-react/useOnchainKit';
import { useMemo } from 'react';
import { useAccount } from 'wagmi';
import { useFundContext } from '../components/FundCardProvider';
import { getOnrampBuyUrl } from '../utils/getOnrampBuyUrl';

export const useFundCardFundingUrl = () => {
Expand Down

0 comments on commit 6b9c6ae

Please sign in to comment.