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

feat(react): add PhoneNumberInput component #64

Merged
merged 11 commits into from
Mar 16, 2023

Conversation

savindi7
Copy link
Contributor

@savindi7 savindi7 commented Mar 10, 2023

Purpose

Add PhoneNumberInput component.

  • Design

Screenshot 2023-03-10 at 17 54 46

Related Issues

Related PRs

  • None

Checklist

  • UX/UI review done on the final implementation.
  • Story provided. (Add screenshots)
  • Manual test round performed and verified.
  • Unit tests provided. (Add links if there are any)
  • Documentation provided. (Add links if there are any)

Security checks

Comment on lines 94 to 95
src={`https://flagcdn.com/${country.code.toLowerCase()}.svg`}
srcSet={`https://flagcdn.com/${country.code.toLowerCase()}.svg 2x`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Using a CDN in a library does not seem right to me. Can we try using flag emojis?
https://dev.to/jorik/country-code-to-flag-emoji-a21

Copy link
Member

@brionmario brionmario Mar 11, 2023

Choose a reason for hiding this comment

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

Emojis might have some issues in Windows. Maybe we can try a well maintained SVG flag library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added react-world-flags package

@savindi7 savindi7 mentioned this pull request Mar 13, 2023
82 tasks

export interface Country {
code: string;
dialCode: string;
Copy link
Member

Choose a reason for hiding this comment

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

Is dialcode a common term?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't use countryCode as it could also be interpreted as the country's ISO country code. Can use phoneCode or the key names used in the MUI example : E.g. { code: 'AI', label: 'Anguilla', phone: '1-264' } - https://mui.com/material-ui/react-autocomplete/#country-select WDYT?

I got the list of codes from here with a few updates to values.

Copy link
Member

@brionmario brionmario Mar 13, 2023

Choose a reason for hiding this comment

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

GPT gave the following. dialCode would be fine i guess. @thivi any ideas here?

The technical term for a country dial code is "International Dialing Code" or "Country Calling Code".

Copy link
Contributor

Choose a reason for hiding this comment

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

Country Calling Codes or Country Dial-in Codes seems to be the standard.
https://en.wikipedia.org/wiki/List_of_country_calling_codes

brionmario
brionmario previously approved these changes Mar 13, 2023
@savindi7 savindi7 merged commit c82df6e into wso2:main Mar 16, 2023
packages/react/package.json Show resolved Hide resolved

export interface Country {
code: string;
dialCode: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Country Calling Codes or Country Dial-in Codes seems to be the standard.
https://en.wikipedia.org/wiki/List_of_country_calling_codes

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.

3 participants