Skip to content

Commit

Permalink
Fixed linting and updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
rililive committed Nov 4, 2021
1 parent ce1b2a5 commit 0adc421
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 48 deletions.
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,31 +155,31 @@ render(){
### Properties:
| Property Name | Type | Default | Description |
| ------------------------- | ---------------- | --------- | ------------------------------------------------------------------------------ |
| autoFormat | boolean | false | Format while typing |
| initialCountry | string | 'us' | initial selected country |
| allowZeroAfterCountryCode | bool | true | allow user input 0 after country code |
| disabled | bool | false | if true, disable all interaction of this component |
| initialValue | string | null | initial phone number |
| style | object | null | custom styles to be applied if supplied |
| flagStyle | object | null | custom styles for flag image eg. {{width: 50, height: 30, borderWidth:0}} |
| textStyle | object | null | custom styles for phone number text input eg. {{fontSize: 14}} |
| textProps | object | null | properties for phone number text input eg. {{placeholder: 'Telephone number'}} |
| textComponent | function | TextField | the input component to use |
| offset | int | 10 | distance between flag and phone number |
| pickerButtonColor | string | '#007AFF' | set button color of country picker |
| pickerBackgroundColor | string | 'white' | set background color of country picker |
| pickerItemStyle | object | null | custom styles for text in country picker eg. {{fontSize: 14}} |
| cancelText | string | 'Cancel' | cancel word |
| confirmText | string | 'Confirm' | confirm word |
| cancelTextStyle | object | null | custom styles for country picker cancel button |
| confirmTextStyle | object | null | custom styles for country picker confirm button |
| onChangePhoneNumber | function(number) | null | function to be invoked when phone number is changed |
| onSelectCountry | function(iso2) | null | function to be invoked when country picker is selected |
| onPressFlag | function() | null | function to be invoked when press on flag image |
| countriesList | array | null | custom countries list |
| autoFormat | bool | false | automatically format phone number as it is entered |
| Property Name | Type | Default | Description |
| ------------------------- | ---------------- | ------------------| ------------------------------------------------------------------------------ |
| autoFormat | boolean | false | Format phone number while typing |
| accessibilityLabel | string | 'Telephone input' | Label for accessibility purposes |
| initialCountry | string | 'us' | initial selected country |
| allowZeroAfterCountryCode | bool | true | allow user input 0 after country code |
| disabled | bool | false | if true, disable all interaction of this component |
| initialValue | string | null | initial phone number |
| style | object | null | custom styles to be applied if supplied |
| flagStyle | object | null | custom styles for flag image eg. {{width: 50, height: 30, borderWidth:0}} |
| textStyle | object | null | custom styles for phone number text input eg. {{fontSize: 14}} |
| textProps | object | null | properties for phone number text input eg. {{placeholder: 'Telephone number'}} |
| textComponent | function | TextField | the input component to use |
| offset | int | 10 | distance between flag and phone number |
| pickerButtonColor | string | '#007AFF' | set button color of country picker |
| pickerBackgroundColor | string | 'white' | set background color of country picker |
| pickerItemStyle | object | null | custom styles for text in country picker eg. {{fontSize: 14}} |
| cancelText | string | 'Cancel' | cancel word |
| confirmText | string | 'Confirm' | confirm word |
| cancelTextStyle | object | null | custom styles for country picker cancel button |
| confirmTextStyle | object | null | custom styles for country picker confirm button |
| onChangePhoneNumber | function(number) | null | function to be invoked when phone number is changed |
| onSelectCountry | function(iso2) | null | function to be invoked when country picker is selected |
| onPressFlag | function() | null | function to be invoked when press on flag image |
| countriesList | array | null | custom countries list |
### Functions:
Expand Down
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-phone-input",
"version": "1.2.1",
"version": "1.2.2",
"description": "Phone input box for React Native",
"main": "dist/index.js",
"scripts": {
Expand Down
38 changes: 19 additions & 19 deletions tests/PhoneNumber.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ import { expect } from 'chai';
import PhoneNumber from '../src/PhoneNumber';

describe('getNumberType', () => {
it('returns UNKNOWN type', () => {
const number = '+44000';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('UNKNOWN');
});
it('returns UNKNOWN type', () => {
const number = '+44000';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('UNKNOWN');
});

it('returns MOBILE type', () => {
const number = '+447900000001';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('MOBILE');
});
it('returns MOBILE type', () => {
const number = '+447900000001';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('MOBILE');
});

it('returns FIXED_LINE type', () => {
const number = '+442072212217';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('FIXED_LINE');
});
});
it('returns FIXED_LINE type', () => {
const number = '+442072212217';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('FIXED_LINE');
});
});

0 comments on commit 0adc421

Please sign in to comment.