-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
src={`https://flagcdn.com/${country.code.toLowerCase()}.svg`} | ||
srcSet={`https://flagcdn.com/${country.code.toLowerCase()}.svg 2x`} |
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.
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
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.
Emojis might have some issues in Windows. Maybe we can try a well maintained SVG flag library.
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.
Added react-world-flags package
|
||
export interface Country { | ||
code: string; | ||
dialCode: string; |
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.
Is dialcode a common term?
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.
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.
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.
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".
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.
Country Calling Codes or Country Dial-in Codes seems to be the standard.
https://en.wikipedia.org/wiki/List_of_country_calling_codes
…ui-1 into feat-phone-number-input
|
||
export interface Country { | ||
code: string; | ||
dialCode: string; |
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.
Country Calling Codes or Country Dial-in Codes seems to be the standard.
https://en.wikipedia.org/wiki/List_of_country_calling_codes
Purpose
Add
PhoneNumberInput
component.Related Issues
Related PRs
Checklist
Security checks