From c3631d1f9cbe363750ff10b836c3a6769ea1de3e Mon Sep 17 00:00:00 2001 From: ayoubechc Date: Thu, 6 Oct 2022 22:54:25 +0100 Subject: [PATCH] fix flag blurry --- lib/index.d.ts | 14 ++++++++++---- lib/index.js | 15 +++++++++------ package.json | 4 ++-- yarn.lock | 39 ++++++++++++--------------------------- 4 files changed, 33 insertions(+), 39 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index cd625e5..7cb348f 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -4,8 +4,8 @@ import { CountryCode, CallingCode, Country, -} from "react-native-country-picker-modal"; -import { CountryFilterProps } from "react-native-country-picker-modal/lib/CountryFilter"; +} from "@olegnjadocode/react-native-country-picker-modal"; +import { CountryFilterProps } from "@olegnjadocode/react-native-country-picker-modal/lib/CountryFilter"; export interface PhoneInputProps { withDarkTheme?: boolean; withShadow?: boolean; @@ -299,9 +299,15 @@ export default class PhoneInput extends Component< getCallingCode: () => string | undefined; isValidNumber: (number: string) => boolean; onSelect: (country: Country) => void; - getNumberAfterPossiblyEliminatingZero: () => {number: string , formattedNumber: string }; + getNumberAfterPossiblyEliminatingZero: () => { + number: string; + formattedNumber: string; + }; onChangeText: (text: string) => void; render(): JSX.Element; } -export function isValidNumber(number: string, countryCode: CountryCode ): boolean; \ No newline at end of file +export function isValidNumber( + number: string, + countryCode: CountryCode +): boolean; diff --git a/lib/index.js b/lib/index.js index b89c388..62bc951 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,7 +6,7 @@ import CountryPicker, { DEFAULT_THEME, CountryModalProvider, Flag, -} from "react-native-country-picker-modal"; +} from "@olegnjadocode/react-native-country-picker-modal"; import { PhoneNumberUtil } from "google-libphonenumber"; import styles from "./styles"; @@ -32,13 +32,16 @@ export default class PhoneInput extends PureComponent { static getDerivedStateFromProps(nextProps, prevState) { if (nextProps.disabled !== prevState.disabled) { - if ((nextProps.value || nextProps.value === "") && nextProps.value !== prevState.number) { - return ({ disabled: nextProps.disabled, number: nextProps.value }); + if ( + (nextProps.value || nextProps.value === "") && + nextProps.value !== prevState.number + ) { + return { disabled: nextProps.disabled, number: nextProps.value }; } - return ({ disabled: nextProps.disabled }); + return { disabled: nextProps.disabled }; } return null; - }; + } async componentDidMount() { const { defaultCode } = this.props; @@ -245,4 +248,4 @@ export const isValidNumber = (number, countryCode) => { } catch (err) { return false; } -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index f4df944..a2361c8 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "android" ], "dependencies": { - "google-libphonenumber": "^3.2.10", - "react-native-country-picker-modal": "^2.0.0" + "@olegnjadocode/react-native-country-picker-modal": "^2.0.2", + "google-libphonenumber": "^3.2.10" }, "devDependencies": { "metro-react-native-babel-preset": "^0.61.0" diff --git a/yarn.lock b/yarn.lock index edf4b71..fdf4ba0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -588,6 +588,17 @@ deepmerge "^3.2.0" hoist-non-react-statics "^3.3.0" +"@olegnjadocode/react-native-country-picker-modal@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@olegnjadocode/react-native-country-picker-modal/-/react-native-country-picker-modal-2.0.2.tgz#f7fcc4f4a0ea10a3e1f1439fb26f70f48b601fc6" + integrity sha512-TK2m6OvtwYm56O3wkGF5lRNmVIa8ImM6EuV+WTSGKcNDVDLQtGn+9F5OMXf/NdSMFF0QLEPT/YXuuK3yG4XK3w== + dependencies: + "@callstack/react-theme-provider" "3.0.3" + fuse.js "3.4.5" + node-emoji "1.10.0" + prop-types "15.7.2" + react-async-hook "3.6.1" + "@types/hoist-non-react-statics@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" @@ -754,7 +765,7 @@ lodash@^4.17.19: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== -loose-envify@^1.0.0, loose-envify@^1.4.0: +loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -811,13 +822,6 @@ minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -modal-react-native-web@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/modal-react-native-web/-/modal-react-native-web-0.2.0.tgz#5daaa76213218fd25df739a267b11aed37e8c0c2" - integrity sha512-sC0/jL3ZL4bGtv1VS43TnrH7/FHUqgb7IU3VYWNDzuR223fYlpG5Gc974GsTP172Vi+lnnBL/G70xONmaggxeQ== - dependencies: - warning "^4.0.1" - ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -874,18 +878,6 @@ react-is@^16.7.0, react-is@^16.8.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-native-country-picker-modal@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/react-native-country-picker-modal/-/react-native-country-picker-modal-2.0.0.tgz#005421303349a81fedf5975e465405bb4b7312d5" - integrity sha512-p0wfkKx1mOCEkn3Qm2/FA8TrxSdUw/nqaCcT6KYvIGmPtPdia1Ce+iWh5G0j2hZcDs6yJSkYAx+7lrZ0HwixAw== - dependencies: - "@callstack/react-theme-provider" "3.0.3" - fuse.js "3.4.5" - modal-react-native-web "0.2.0" - node-emoji "1.10.0" - prop-types "15.7.2" - react-async-hook "3.6.1" - react-refresh@^0.4.0: version "0.4.3" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53" @@ -995,10 +987,3 @@ unicode-property-aliases-ecmascript@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== - -warning@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" - integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w== - dependencies: - loose-envify "^1.0.0"