-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use correct phone placeholder depending on the country on joining Celo view #2061
Use correct phone placeholder depending on the country on joining Celo view #2061
Conversation
97484bd
to
defee69
Compare
@@ -49,6 +50,7 @@ export default class PhoneNumberInput extends React.Component<Props, State> { | |||
phoneNumber: '', | |||
// country data should be fetched before mounting to prevent a second render | |||
countries: new Countries(this.props.lng), | |||
inputPhonePlaceholder: this.props.inputPhonePlaceholder, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rename the prop, how about initialInputPhonePlaceholder
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'm going to change it
73eafa8
to
60c0884
Compare
packages/utils/src/phoneNumbers.ts
Outdated
@@ -231,6 +231,34 @@ export function anonymizedPhone(phoneNumber: string) { | |||
return phoneNumber.slice(0, -4) + 'XXXX' | |||
} | |||
|
|||
export function getExampleNumber( | |||
regionCode: string, | |||
showZero: boolean = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest renaming to useOnlyZeroes
packages/utils/src/countries.ts
Outdated
@@ -140,6 +146,10 @@ export class Countries { | |||
const localizedCountry = { | |||
names, | |||
displayName: names[this.language], | |||
countryPhonePlaceholder: { | |||
national: getExampleNumber(country.countryCallingCodes[0]), | |||
internation: getExampleNumber(country.countryCallingCodes[0], true, true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we need the international version right? Let's not calculate one for each country. Keep in mind this re-runs each time the app opens.
Also, typo: internatio
-> international
eaeb7dd
to
79e93c6
Compare
Codecov Report
@@ Coverage Diff @@
## master #2061 +/- ##
========================================
Coverage 74.81% 74.81%
========================================
Files 276 276
Lines 7766 7766
Branches 976 692 -284
========================================
Hits 5810 5810
Misses 1839 1839
Partials 117 117
Continue to review full report at Codecov.
|
0d3433f
to
bfd7f8d
Compare
65c8884
to
5e367d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Please address the useZeros
comment before merging.
e5f6933
to
a8d8b00
Compare
0ecf6dc
to
a8430d0
Compare
a8430d0
to
c9758d8
Compare
* master: (40 commits) Add utils as a dep (#2252) [Wallet] Create run_app.sh script to facilitate app development (#2186) [Wallet] Fix persisted data loss on iOS (#2249) adds Testing TSX /react on the web (#2229) Update running-a-validator.md (#2259) Add ts-ignore (#2254) Revert "Revert "Upgrade TS version (#2196)" (#2251)" (#2255) Force same bignumber version (#2256) Fix missing Text on website (#2237) Revert "Upgrade TS version (#2196)" (#2251) [Wallet] Refer to Celo Lite as "Data Saver" mode (#2232) Fix using requester instead of requestee at Outgoing notifications (#2240) Use correct phone placeholder depending on the country on joining Celo view (#2061) Update Attestation Bot Docker Image (#2231) Baklava phase 1.1 .env file (#2226) [Docs] Fix typo (#2225) Upgrade Dependencies and get react hooks working (#2203) Update attestation service docker images (#2202) Updates TME docker images (#2200) Remove walletkit from celotool transactions commands (#2206) ... # Conflicts: # packages/web/package.json
* master: Add utils as a dep (#2252) [Wallet] Create run_app.sh script to facilitate app development (#2186) [Wallet] Fix persisted data loss on iOS (#2249) adds Testing TSX /react on the web (#2229) Update running-a-validator.md (#2259) Add ts-ignore (#2254) Revert "Revert "Upgrade TS version (#2196)" (#2251)" (#2255) Force same bignumber version (#2256) Fix missing Text on website (#2237) Revert "Upgrade TS version (#2196)" (#2251) [Wallet] Refer to Celo Lite as "Data Saver" mode (#2232) Fix using requester instead of requestee at Outgoing notifications (#2240) Use correct phone placeholder depending on the country on joining Celo view (#2061) Update Attestation Bot Docker Image (#2231) Baklava phase 1.1 .env file (#2226) [Docs] Fix typo (#2225) Upgrade Dependencies and get react hooks working (#2203) Update attestation service docker images (#2202) Updates TME docker images (#2200) Remove walletkit from celotool transactions commands (#2206)
Description
Use correct phone placeholder depending on the country on joining Celo view
Tested
Tested on Android phone
Related issues