Skip to content

Commit

Permalink
chore: Move Primitives to internal/components directory (#1876)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer authored Jan 24, 2025
1 parent 240b802 commit 64f704d
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 29 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useTheme } from '@/core-react/internal/hooks/useTheme';
import { cn } from '@/styles/theme';
import type React from 'react';
import { useRef } from 'react';
import { createPortal } from 'react-dom';
import { useTheme } from '../../core-react/internal/hooks/useTheme';
import { cn } from '../../styles/theme';
import { DismissableLayer } from './DismissableLayer';
import { FocusTrap } from './FocusTrap';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useTheme } from '@/core-react/internal/hooks/useTheme';
import { cn } from '@/styles/theme';
import type React from 'react';
import { useCallback, useEffect, useRef } from 'react';
import { createPortal } from 'react-dom';
import { useTheme } from '../../core-react/internal/hooks/useTheme';
import { cn } from '../../styles/theme';
import { DismissableLayer } from './DismissableLayer';
import { FocusTrap } from './FocusTrap';

Expand Down
6 changes: 3 additions & 3 deletions src/swap/components/SwapSettings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ vi.mock('../../ui/react/internal/hooks/useBreakpoints', () => ({
useBreakpoints: vi.fn(),
}));

vi.mock('../../internal/primitives/FocusTrap', () => ({
vi.mock('../../internal/components/primitives/FocusTrap', () => ({
FocusTrap: vi.fn(({ children }) => (
<div data-testid="mock-focus-trap">{children}</div>
)),
}));

vi.mock('../../internal/primitives/DismissableLayer', () => ({
vi.mock('../../internal/components/primitives/DismissableLayer', () => ({
DismissableLayer: vi.fn(({ children, onDismiss }) => (
<div
data-testid="mock-dismissable-layer"
Expand All @@ -65,7 +65,7 @@ vi.mock('../../internal/primitives/DismissableLayer', () => ({
)),
}));

vi.mock('../../internal/primitives/Popover', () => ({
vi.mock('../../internal/components/primitives/Popover', () => ({
Popover: vi.fn(({ children, isOpen, onClose }) =>
isOpen ? (
<div
Expand Down
12 changes: 6 additions & 6 deletions src/swap/components/SwapSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useIcon } from '@/core-react/internal/hooks/useIcon';
import { DismissableLayer } from '@/internal/components/primitives/DismissableLayer';
import { FocusTrap } from '@/internal/components/primitives/FocusTrap';
import { Popover } from '@/internal/components/primitives/Popover';
import { background, border, cn, pressable, text } from '@/styles/theme';
import { useBreakpoints } from '@/ui/react/internal/hooks/useBreakpoints';
import { useCallback, useRef, useState } from 'react';
import { useIcon } from '../../core-react/internal/hooks/useIcon';
import { DismissableLayer } from '../../internal/primitives/DismissableLayer';
import { FocusTrap } from '../../internal/primitives/FocusTrap';
import { Popover } from '../../internal/primitives/Popover';
import { background, border, cn, pressable, text } from '../../styles/theme';
import { useBreakpoints } from '../../ui/react/internal/hooks/useBreakpoints';
import type { SwapSettingsReact } from '../types';
import { SwapSettingsSlippageLayout } from './SwapSettingsSlippageLayout';
import { SwapSettingsSlippageLayoutBottomSheet } from './SwapSettingsSlippageLayoutBottomSheet';
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/components/WalletModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ vi.mock('wagmi/connectors', () => ({
}),
}));

vi.mock('../../internal/primitives/Dialog', () => ({
vi.mock('../../internal/components/primitives/Dialog', () => ({
Dialog: vi.fn(
({
children,
Expand Down
23 changes: 8 additions & 15 deletions src/wallet/components/WalletModal.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
'use client';

import { Dialog } from '@/internal/components/primitives/Dialog';
import { CloseSvg } from '@/internal/svg/closeSvg';
import { coinbaseWalletSvg } from '@/internal/svg/coinbaseWalletSvg';
import { defaultAvatarSVG } from '@/internal/svg/defaultAvatarSVG';
import { metamaskSvg } from '@/internal/svg/metamaskSvg';
import { phantomSvg } from '@/internal/svg/phantomSvg';
import { background, border, cn, color, pressable, text } from '@/styles/theme';
import { useOnchainKit } from '@/useOnchainKit';
import { useCallback } from 'react';
import { useConnect } from 'wagmi';
import { coinbaseWallet, injected, metaMask } from 'wagmi/connectors';
import { Dialog } from '../../internal/primitives/Dialog';
import { CloseSvg } from '../../internal/svg/closeSvg';
import { coinbaseWalletSvg } from '../../internal/svg/coinbaseWalletSvg';
import { defaultAvatarSVG } from '../../internal/svg/defaultAvatarSVG';
import { metamaskSvg } from '../../internal/svg/metamaskSvg';
import { phantomSvg } from '../../internal/svg/phantomSvg';
import {
background,
border,
cn,
color,
pressable,
text,
} from '../../styles/theme';
import { useOnchainKit } from '../../useOnchainKit';

type WalletModalProps = {
isOpen: boolean;
Expand Down

0 comments on commit 64f704d

Please sign in to comment.