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

Fixed issue 6: Added functionality to show only specific countries to select #9

Merged

Conversation

ahmed-gelemli
Copy link
Contributor

Overview

This pull request adds a new feature to the PhoneNumberInput component that allows users to specify and select a list of countries. This enhances the flexibility of the component by enabling developers to restrict the country selection to a predefined list.

Changes Made

  • Added a new optional prop onlyCountries?: string[] to the PhoneNumberInput component.
  • Updated the README.md to include documentation for the new onlyCountries prop.
  • Provided an example usage of the onlyCountries prop in the README.md:
<PhoneNumberInput
  code={countryCode}
  setCode={setCountryCode}
  phoneNumber={phoneNumber}
  setPhoneNumber={setPhoneNumber}
  onlyCountries={["AZ", "BD", "CA", "GB", "IN", "NZ", "US", "TR", "AU"]}
/>

Testing

  • Verified that the component only displays the specified countries in the country picker when the onlyCountries prop is provided.
  • Ensured that the component functions as expected when the onlyCountries prop is not provided, showing all available countries.

Documentation

Updated the README.md file to reflect the addition of the onlyCountries prop.

Impact

This update is backward compatible and does not affect existing functionality. It simply adds an optional feature for greater customization.

@kuasha420
Copy link
Owner

Hi @ahmed-gelemli I'll review both of your PRs, but it looks like both PR is created from the same branch, so the commits are the same and bleeding into each other. If you can, it would make the review easier if you changed the branch for each PR in your fork. Cheers.

@ahmed-gelemli
Copy link
Contributor Author

Hi @kuasha420 I did create different branches for each issue. Each PR has its own changes so it, I hope, is easier to review now.

Copy link
Owner

@kuasha420 kuasha420 left a comment

Choose a reason for hiding this comment

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

Thanks @ahmed-gelemli. LGTM

@kuasha420 kuasha420 merged commit eda28fb into kuasha420:develop Jul 29, 2024
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.

2 participants