react-native-international-phone-number 0.8.2 β†’ 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,16 +37,32 @@
37
37
  </a>
38
38
  </div>
39
39
 
40
+ <br>
41
+
42
+ ## Features
43
+
44
+ - πŸ“± Works with iOS, Android (Cross-platform), Expo and Web;
45
+ - 🎨 Lib with UI customizable;
46
+ - 🌎 Phone Input Mask according with the selected country;
47
+ - πŸ‘¨β€πŸ’» Functional and class component support;
48
+ - 🈢 22 languages supported.
49
+
50
+ <br>
51
+
40
52
  ## Try it out
41
53
 
42
54
  - [Demo](https://snack.expo.dev/@astroonauta/react-native-international-phone-number)
43
55
 
56
+ <br>
57
+
44
58
  ## List of Contents
45
59
 
46
60
  - [Old Versions](#old-versions)
47
61
  - [Installation](#installation)
48
- - [Additional Config to Web](#additional-config-to-web)
49
- - [Features](#features)
62
+ - [Additional Config](#additional-config)
63
+ - [React Native CLI](#using-react-native-cli)
64
+ - [Expo](#using-expo)
65
+ - [Web](#using-web)
50
66
  - [Basic Usage](#basic-usage)
51
67
  - [With Class Component](#class-component)
52
68
  - [With Function Component](#function-component)
@@ -102,11 +118,11 @@ OR
102
118
  $ yarn add react-native-international-phone-number
103
119
  ```
104
120
 
105
- ## Additional config to `Web`
121
+ ## Additional config
106
122
 
107
- - Using React Native CLI:
123
+ - ### Using React Native CLI:
108
124
 
109
- create a `react-native.config.js` file at the root of your react-native project with:
125
+ Create a `react-native.config.js` file at the root of your react-native project with:
110
126
 
111
127
  ```bash
112
128
  module.exports = {
@@ -126,23 +142,10 @@ Then link the font to your native projects with:
126
142
  npx react-native-asset
127
143
  ```
128
144
 
129
- - Using Expo:
145
+ - ### Using Expo:
130
146
 
131
- 1. Change the `app.json` file to:
132
-
133
- ```bash
134
- ...
135
-
136
- "web": {
137
- ...
138
- "output": "single",
139
- ...
140
- },
141
- ...
142
- ```
143
-
144
- 2. Install [expo-fonts](https://docs.expo.dev/versions/latest/sdk/font/): `npx expo install expo-font`;
145
- 3. Initialize the `expo-font`:
147
+ 1. Install [expo-fonts](https://docs.expo.dev/versions/latest/sdk/font/): `npx expo install expo-font`;
148
+ 2. Initialize the `expo-font`:
146
149
 
147
150
  ```bash
148
151
  import { useFonts } from 'expo-font';
@@ -156,17 +159,22 @@ npx react-native-asset
156
159
  ...
157
160
  ```
158
161
 
159
- > Observation: _you need to recompile your project after adding new fonts._
162
+ > Observation: you need to recompile your project after adding new fonts.
160
163
 
161
- <br>
164
+ - ### Using Web:
162
165
 
163
- ## Features
166
+ Change the `app.json` file to:
164
167
 
165
- - πŸ“± Works with iOS, Android (Cross-platform), Expo and Web;
166
- - 🎨 Lib with UI customizable;
167
- - 🌎 Phone Input Mask according with the selected country;
168
- - πŸ‘¨β€πŸ’» Functional and class component support;
169
- - 🈢 21 languages supported.
168
+ ```bash
169
+ ...
170
+
171
+ "web": {
172
+ ...
173
+ "output": "single",
174
+ ...
175
+ },
176
+ ...
177
+ ```
170
178
 
171
179
  <br>
172
180
 
@@ -423,12 +423,7 @@ export const countries = [
423
423
  zh: '澳倧利亞',
424
424
  tr: 'Avustralya',
425
425
  },
426
- phoneMasks: [
427
- '2 #### ####',
428
- '3 #### ####',
429
- '4## ### ###',
430
- '7 #### ####',
431
- ],
426
+ phoneMasks: ['### ### ###'],
432
427
  },
433
428
  {
434
429
  callingCode: '+297',
@@ -5182,7 +5177,9 @@ export const countries = [
5182
5177
  zh: '巴拿馬',
5183
5178
  tr: 'Panama',
5184
5179
  },
5185
- phoneMasks: ['### ####'],
5180
+ // https://en.wikipedia.org/wiki/Telephone_numbers_in_Panama
5181
+ // Mobile numbers in Panama always start with 6 and are eight digits.
5182
+ phoneMasks: ['### ####', '6### ####'],
5186
5183
  },
5187
5184
  {
5188
5185
  callingCode: '+51',
package/lib/index.js CHANGED
@@ -331,27 +331,30 @@ const PhoneInput = forwardRef(
331
331
  } else {
332
332
  // Create a separate constant for each part of the component
333
333
  const touchableStart = (
334
- <Text style={getFlagStyle(phoneInputStyles?.flag)}>
335
- {countryValue?.flag}
336
- </Text>
337
- );
338
- {
339
- customCaret || (
340
- <View style={phoneInputStyles?.caret}>
341
- <View
342
- style={{
343
- flexDirection: 'row',
344
- justifyContent: 'center',
345
- paddingTop: 4,
346
- }}
347
- >
334
+ <>
335
+ <Text style={getFlagStyle(phoneInputStyles?.flag)}>
336
+ {countryValue?.flag}
337
+ </Text>
338
+ {customCaret || (
339
+ <View style={phoneInputStyles?.caret}>
348
340
  <View
349
- style={getCaretStyle(theme, phoneInputStyles?.caret)}
350
- />
341
+ style={{
342
+ flexDirection: 'row',
343
+ justifyContent: 'center',
344
+ paddingTop: 4,
345
+ }}
346
+ >
347
+ <View
348
+ style={getCaretStyle(
349
+ theme,
350
+ phoneInputStyles?.caret
351
+ )}
352
+ />
353
+ </View>
351
354
  </View>
352
- </View>
353
- );
354
- }
355
+ )}
356
+ </>
357
+ );
355
358
 
356
359
  const touchableMiddle = (
357
360
  <View
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-international-phone-number",
3
3
  "author": "AstrOOnauta (https://github.com/AstrOOnauta)",
4
- "version": "0.8.2",
4
+ "version": "0.8.3",
5
5
  "description": "International mobile phone input component with mask for React Native",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",