Skip to content

Commit 0de3d44

Browse files
authored
Infra/dependencies graph preparation 2 (#3152)
* Move mock to __tests__ * Rename sub components to match their file name
1 parent 5fa1a40 commit 0de3d44

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

src/components/colorPicker/ColorPickerDialog.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {Colors} from '../../style';
66
import {ModalProps} from '../../components/modal';
77
import Dialog, {DialogProps} from '../../incubator/Dialog';
88
import {getColorValue, getValidColorString, getTextColor, BORDER_RADIUS, HSLColor} from './ColorPickerPresenter';
9-
import Header from './ColorPickerDialogHeader';
10-
import Preview from './ColorPickerPreview';
11-
import Sliders from './ColorPickerDialogSliders';
9+
import ColorPickerDialogHeader from './ColorPickerDialogHeader';
10+
import ColorPickerPreview from './ColorPickerPreview';
11+
import ColorPickerDialogSliders from './ColorPickerDialogSliders';
1212

1313
export interface ColorPickerDialogProps extends DialogProps {
1414
/**
@@ -165,15 +165,15 @@ const ColorPickerDialog = (props: ColorPickerDialogProps) => {
165165
modalProps={MODAL_PROPS}
166166
{...dialogProps}
167167
>
168-
<Header
168+
<ColorPickerDialogHeader
169169
accessibilityLabels={accessibilityLabels}
170170
valid={valid}
171171
onDonePressed={onDonePressed}
172172
testID={testID}
173173
doneButtonColor={doneButtonColor}
174174
onDismiss={onDismiss}
175175
/>
176-
<Preview
176+
<ColorPickerPreview
177177
color={color}
178178
text={text}
179179
valid={valid}
@@ -183,7 +183,12 @@ const ColorPickerDialog = (props: ColorPickerDialogProps) => {
183183
onFocus={onFocus}
184184
onChangeText={onChangeText}
185185
/>
186-
<Sliders keyboardHeight={keyboardHeight} color={color} onSliderValueChange={updateColor} migrate={migrate}/>
186+
<ColorPickerDialogSliders
187+
keyboardHeight={keyboardHeight}
188+
color={color}
189+
onSliderValueChange={updateColor}
190+
migrate={migrate}
191+
/>
187192
</Dialog>
188193
);
189194
};

src/components/colorPicker/ColorPickerDialogHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type HeaderProps = Pick<ColorPickerDialogProps, 'doneButtonColor' | 'accessibili
1515
onDonePressed: () => void;
1616
};
1717

18-
const Header = (props: HeaderProps) => {
18+
const ColorPickerDialogHeader = (props: HeaderProps) => {
1919
const {onDismiss, accessibilityLabels, testID, doneButtonColor, valid, onDonePressed} = props;
2020

2121
return (
@@ -41,7 +41,7 @@ const Header = (props: HeaderProps) => {
4141
);
4242
};
4343

44-
export default Header;
44+
export default ColorPickerDialogHeader;
4545

4646
const styles = StyleSheet.create({
4747
header: {

src/components/colorPicker/ColorPickerDialogSliders.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type SlidersProps = Pick<ColorPickerDialogProps, 'migrate'> & {
1111
onSliderValueChange: (value: HSLColor) => void;
1212
};
1313

14-
const Sliders = (props: SlidersProps) => {
14+
const ColorPickerDialogSliders = (props: SlidersProps) => {
1515
const {keyboardHeight, color, migrate, onSliderValueChange} = props;
1616
const colorValue = color.a === 0 ? Colors.getHSL(Colors.$backgroundInverted) : color;
1717

@@ -29,7 +29,7 @@ const Sliders = (props: SlidersProps) => {
2929
);
3030
};
3131

32-
export default Sliders;
32+
export default ColorPickerDialogSliders;
3333

3434
const styles = StyleSheet.create({
3535
sliderGroup: {

src/components/colorPicker/ColorPickerPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type PreviewProps = Pick<ColorPickerDialogProps, 'accessibilityLabels' | 'previe
1616
onChangeText: (value: string) => void;
1717
onFocus: () => void;
1818
};
19-
const Preview = (props: PreviewProps) => {
19+
const ColorPickerPreview = (props: PreviewProps) => {
2020
const {color, text, onChangeText, previewInputStyle, onFocus, accessibilityLabels, testID} = props;
2121
const textInput = useRef<TextInput>(null);
2222

@@ -77,7 +77,7 @@ const Preview = (props: PreviewProps) => {
7777
);
7878
};
7979

80-
export default Preview;
80+
export default ColorPickerPreview;
8181

8282
const styles = StyleSheet.create({
8383
header: {

src/components/sectionsWheelPicker/__tests__/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import SectionsWheelPicker from '../index';
44
import {render} from '@testing-library/react-native';
55
import {SectionsWheelPickerDriver} from '../SectionsWheelPicker.driver';
6-
import {sections, labels} from '../mockSections';
6+
import {sections, labels} from './mockSections';
77

88
const testID = 'sectionsWheel';
99
const onChange = jest.fn();

0 commit comments

Comments
 (0)