Skip to content
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

Merged

Conversation

Pedro-vk
Copy link
Contributor

@Pedro-vk Pedro-vk commented Dec 5, 2019

Description

Use correct phone placeholder depending on the country on joining Celo view

Tested

Tested on Android phone

Related issues

@Pedro-vk Pedro-vk requested a review from cmcewen as a code owner December 5, 2019 13:28
@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch from 97484bd to defee69 Compare December 5, 2019 13:48
packages/utils/src/phoneNumbers.ts Outdated Show resolved Hide resolved
packages/utils/src/phoneNumbers.ts Show resolved Hide resolved
@@ -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,
Copy link
Contributor

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?

Copy link
Contributor Author

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

@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch 3 times, most recently from 73eafa8 to 60c0884 Compare December 5, 2019 16:04
@@ -231,6 +231,34 @@ export function anonymizedPhone(phoneNumber: string) {
return phoneNumber.slice(0, -4) + 'XXXX'
}

export function getExampleNumber(
regionCode: string,
showZero: boolean = true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest renaming to useOnlyZeroes

@@ -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),
Copy link
Contributor

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

packages/utils/src/phoneNumbers.ts Show resolved Hide resolved
@jmrossy jmrossy assigned Pedro-vk and unassigned jmrossy Dec 5, 2019
@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch 3 times, most recently from eaeb7dd to 79e93c6 Compare December 10, 2019 15:28
@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #2061 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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
Flag Coverage Δ
#mobile 74.81% <ø> (ø) ⬆️
Impacted Files Coverage Δ
packages/mobile/src/invite/JoinCelo.tsx 81.69% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32b424a...c9758d8. Read the comment docs.

@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch 4 times, most recently from 0d3433f to bfd7f8d Compare December 11, 2019 13:41
@Pedro-vk Pedro-vk requested a review from jmrossy December 11, 2019 13:43
@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch 4 times, most recently from 65c8884 to 5e367d5 Compare December 12, 2019 11:28
Copy link
Contributor

@jmrossy jmrossy left a 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.

@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch 3 times, most recently from e5f6933 to a8d8b00 Compare December 12, 2019 16:30
@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch 5 times, most recently from 0ecf6dc to a8430d0 Compare December 12, 2019 22:50
@Pedro-vk Pedro-vk force-pushed the bugfix/#865-country-code-input-size branch from a8430d0 to c9758d8 Compare December 13, 2019 08:52
@Pedro-vk Pedro-vk merged commit c363f02 into celo-org:master Dec 13, 2019
@Pedro-vk Pedro-vk deleted the bugfix/#865-country-code-input-size branch December 13, 2019 10:39
aaronmgdr added a commit that referenced this pull request Dec 16, 2019
* 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
aaronmgdr added a commit that referenced this pull request Dec 16, 2019
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users SBAT see phone number input placeholder that matches the country they select
2 participants