Skip to content

Commit 31ed886

Browse files
refactor: updated phone field type name
1 parent 50cddfe commit 31ed886

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

apps/meteor/client/components/PhoneNumberFieldList/PhoneNumberFieldList.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import userEvent from '@testing-library/user-event';
44
import { axe } from 'jest-axe';
55
import { useFieldArray, useForm } from 'react-hook-form';
66

7-
import type { PhoneField } from './PhoneNumberFieldList';
7+
import type { PhoneFieldType } from './PhoneNumberFieldList';
88
import PhoneNumberFieldList from './PhoneNumberFieldList';
99

10-
type PhoneFormValues = { phones: PhoneField[] };
10+
type PhoneFormValues = { phones: PhoneFieldType[] };
1111

1212
type TestComponentProps = {
13-
initialPhones?: PhoneField[];
13+
initialPhones?: PhoneFieldType[];
1414
onAddPhone: jest.Mock;
1515
onRemovePhone: jest.Mock;
1616
};

apps/meteor/client/components/PhoneNumberFieldList/PhoneNumberFieldList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
88
const E164_PHONE_REGEX = /^\+?[1-9]\d{1,14}$/;
99
const MAX_PHONE_NUMBER_LABEL_LENGTH = 50;
1010

11-
export type PhoneField = {
11+
export type PhoneFieldType = {
1212
id: string;
1313
number?: string;
1414
label?: string;
@@ -17,9 +17,9 @@ export type PhoneField = {
1717

1818
type PhoneNumberFieldListProps<T extends FieldValues> = {
1919
name: ArrayPath<T>;
20-
phones: PhoneField[];
20+
phones: PhoneFieldType[];
2121
control: Control<T>;
22-
onAddPhone: (phone: Omit<Required<PhoneField>, 'id'>) => void;
22+
onAddPhone: (phone: Omit<Required<PhoneFieldType>, 'id'>) => void;
2323
onRemovePhone: (index: number) => void;
2424
};
2525

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { default } from './PhoneNumberFieldList';
2-
export type { PhoneField } from './PhoneNumberFieldList';
2+
export type { PhoneFieldType } from './PhoneNumberFieldList';

0 commit comments

Comments
 (0)