react-native-international-phone-number 0.2.7 → 0.2.8
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 +29 -0
- package/lib/index.d.ts +7 -2
- package/lib/index.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -204,6 +204,35 @@ export default function App() {
|
|
|
204
204
|
}
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
+
## Customizing lib
|
|
208
|
+
|
|
209
|
+
### Dark mode:
|
|
210
|
+
|
|
211
|
+
```jsx
|
|
212
|
+
<PhoneInput
|
|
213
|
+
...
|
|
214
|
+
withDarkTheme
|
|
215
|
+
/>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### containerStyle + inputStyle:
|
|
219
|
+
|
|
220
|
+
```jsx
|
|
221
|
+
<PhoneInput
|
|
222
|
+
...
|
|
223
|
+
inputStyle={{
|
|
224
|
+
color: '#F3F3F3',
|
|
225
|
+
}}
|
|
226
|
+
containerStyle={{
|
|
227
|
+
backgroundColor: '#575757',
|
|
228
|
+
borderWidth: 1,
|
|
229
|
+
borderStyle: 'solid',
|
|
230
|
+
borderColor: '#F3F3F3',
|
|
231
|
+
marginVertical: 16,
|
|
232
|
+
}}
|
|
233
|
+
/>
|
|
234
|
+
```
|
|
235
|
+
|
|
207
236
|
## Props
|
|
208
237
|
|
|
209
238
|
- `value?`: string
|
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyleProp,
|
|
4
|
+
TextInputProps,
|
|
5
|
+
TextStyle,
|
|
6
|
+
ViewStyle,
|
|
7
|
+
} from 'react-native';
|
|
3
8
|
import { Country } from 'react-native-country-picker-modal';
|
|
4
9
|
|
|
5
10
|
interface PhoneInputProps extends TextInputProps {
|
|
6
11
|
placeholder?: string;
|
|
7
12
|
placeholderTextColor?: string;
|
|
8
13
|
containerStyle?: StyleProp<ViewStyle>;
|
|
9
|
-
inputStyle?: StyleProp<
|
|
14
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
10
15
|
withDarkTheme?: boolean;
|
|
11
16
|
disabled?: boolean;
|
|
12
17
|
selectedCountry: undefined | Country;
|
package/lib/index.js
CHANGED
|
@@ -46,7 +46,9 @@ function PhoneInput({
|
|
|
46
46
|
}, []);
|
|
47
47
|
|
|
48
48
|
return (
|
|
49
|
-
<View
|
|
49
|
+
<View
|
|
50
|
+
style={[styles.container, containerStyle ? containerStyle : {}]}
|
|
51
|
+
>
|
|
50
52
|
<CountryPicker
|
|
51
53
|
containerButtonStyle={{
|
|
52
54
|
paddingLeft: 20,
|
|
@@ -58,7 +60,7 @@ function PhoneInput({
|
|
|
58
60
|
countryCode={selectedCountry ? selectedCountry.cca2 : 'BR'}
|
|
59
61
|
/>
|
|
60
62
|
<TextInput
|
|
61
|
-
style={inputStyle ? inputStyle :
|
|
63
|
+
style={[styles.input, inputStyle ? inputStyle : {}]}
|
|
62
64
|
placeholder={
|
|
63
65
|
placeholder ? placeholder : 'Insert your phone number'
|
|
64
66
|
}
|
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.2.
|
|
4
|
+
"version": "0.2.8",
|
|
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",
|