Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import type {
CallingCode,
CountryCode,
} from 'react-native-country-picker-modal';
import { PhoneInput, isValidNumber } from 'react-native-phone-entry';
import {
PhoneInput,
isValidNumber,
type CallingCode,
type CountryCode,
} from 'react-native-phone-entry';

export default function App() {
const [phoneNumber, setPhoneNumber] = useState('');
Expand Down
3 changes: 2 additions & 1 deletion src/PhoneInput/PhoneInput.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ export type PhoneInputProps = {
renderCustomDropdown?: JSX.Element;
theme?: Theme;
maskInputProps?: MaskInputProps;
countryPickerProps?: Parameters<typeof CountryPicker>[0];
countryPickerProps?: Partial<Parameters<typeof CountryPicker>[0]>;
flagProps?: Parameters<typeof Flag>[0];
isCallingCodeEditable?: boolean;
dropDownImageProps?: ImageProps;
};

interface Theme {
containerStyle?: StyleProp<ViewStyle>;
textInputStyle?: StyleProp<TextStyle>;
Expand Down
4 changes: 2 additions & 2 deletions src/PhoneInput/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ export const MASK_PER_COUNTRY: Partial<{
NZ: [/\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/],
NI: [/\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
NE: [/\d/, /\d/, '-', /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
NG: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/],
NG: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
NU: [/\d/, /\d/, /\d/, /\d/],
MK: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/],
MP: ['(', '6', '7', '0', ')', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
Expand Down Expand Up @@ -720,7 +720,7 @@ export const MASK_PER_COUNTRY: Partial<{
WS: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
SM: [/\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/, /\d/, /\d/],
ST: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/, /\d/],
SA: [/\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
SA: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
SN: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
RS: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
SC: [/\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/],
Expand Down
5 changes: 5 additions & 0 deletions src/PhoneInput/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ export { PhoneInput } from './PhoneInput';
export { isValidNumber } from './utils';

export type { PhoneInputProps } from './PhoneInput.types';

export type {
CallingCode,
CountryCode,
} from 'react-native-country-picker-modal';
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ export {
isValidNumber,
MASK_PER_COUNTRY,
PhoneInput,
type CallingCode,
type CountryCode,
type PhoneInputProps,
} from './PhoneInput';
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4855,9 +4855,9 @@ __metadata:
linkType: hard

"caniuse-lite@npm:^1.0.30001688":
version: 1.0.30001695
resolution: "caniuse-lite@npm:1.0.30001695"
checksum: 97729756cc19e9a93d46061ff11690d9a7d2facdb9c275111b19548adcba29d29638339bd6e659b7ddcb3649f17926a66a4cfb407605232f21918b70650a40be
version: 1.0.30001745
resolution: "caniuse-lite@npm:1.0.30001745"
checksum: a018bfbf6eda6e2728184cd39f3d0438cea04011893664fc7de19568d8e6f26cbc09e59460137bb2f4e792d1cdb7f1a48ad35f31a1c1388c1d7f74b3c889d35b
languageName: node
linkType: hard

Expand Down