diff --git a/src/Checkbox/Checkbox.tsx b/src/Checkbox/Checkbox.tsx index c630dc9d..1b245ebd 100644 --- a/src/Checkbox/Checkbox.tsx +++ b/src/Checkbox/Checkbox.tsx @@ -3,15 +3,15 @@ import styled, { css } from 'styled-components'; import { createHatchedBackground } from '../common'; import useControlledOrUncontrolled from '../common/hooks/useControlledOrUncontrolled'; -import { noOp } from '../common/utils'; -import { StyledMenuListItem } from '../MenuList/MenuList'; -import { StyledScrollView } from '../ScrollView/ScrollView'; import { LabelText, size, StyledInput, StyledLabel -} from '../SwitchBase/SwitchBase'; +} from '../common/SwitchBase'; +import { noOp } from '../common/utils'; +import { StyledMenuListItem } from '../MenuList/MenuList'; +import { StyledScrollView } from '../ScrollView/ScrollView'; import { CommonThemeProps } from '../types'; type CheckboxProps = { diff --git a/src/Radio/Radio.tsx b/src/Radio/Radio.tsx index bfcbdda4..f49b51ca 100644 --- a/src/Radio/Radio.tsx +++ b/src/Radio/Radio.tsx @@ -2,14 +2,14 @@ import React, { forwardRef } from 'react'; import styled, { css, CSSProperties } from 'styled-components'; import { createFlatBoxStyles } from '../common'; -import { StyledMenuListItem } from '../MenuList/MenuList'; -import { StyledScrollView } from '../ScrollView/ScrollView'; import { LabelText, size, StyledInput, StyledLabel -} from '../SwitchBase/SwitchBase'; +} from '../common/SwitchBase'; +import { StyledMenuListItem } from '../MenuList/MenuList'; +import { StyledScrollView } from '../ScrollView/ScrollView'; import { CommonStyledProps } from '../types'; type RadioVariant = 'default' | 'flat' | 'menu'; diff --git a/src/SwitchBase/SwitchBase.ts b/src/common/SwitchBase.ts similarity index 94% rename from src/SwitchBase/SwitchBase.ts rename to src/common/SwitchBase.ts index 885cdb72..717e268f 100644 --- a/src/SwitchBase/SwitchBase.ts +++ b/src/common/SwitchBase.ts @@ -1,6 +1,6 @@ import styled, { css } from 'styled-components'; -import { createDisabledTextStyles, focusOutline } from '../common'; +import { createDisabledTextStyles, focusOutline } from '.'; import { StyledMenuListItem } from '../MenuList/MenuList'; export const size = 20; diff --git a/src/common/hooks/useForkRef.spec.tsx b/src/common/hooks/useForkRef.spec.tsx index 2e3395ee..9218a225 100644 --- a/src/common/hooks/useForkRef.spec.tsx +++ b/src/common/hooks/useForkRef.spec.tsx @@ -36,10 +36,7 @@ describe('useForkRef', () => { }); it('forks if only one of the branches requires a ref', () => { - const Component = React.forwardRef(function Component( - _, - ref - ) { + const Component = React.forwardRef((_, ref) => { const [hasRef, setHasRef] = useState(false); const handleOwnRef = useCallback(() => setHasRef(true), []); const handleRef = useForkRef(handleOwnRef, ref); @@ -60,10 +57,7 @@ describe('useForkRef', () => { children: React.ReactElement; }; - const Outer = React.forwardRef(function Outer( - props, - ref - ) { + const Outer = React.forwardRef((props, ref) => { const { children } = props; // TODO: Fix this test as reading ref from children is not allowed so not available on React types