Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CountrySelector.js 897B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import React from 'react';
  3. import { Icon, IconArrowDown } from '../../../base/icons';
  4. type Props = {
  5. /**
  6. * Country object of the entry.
  7. */
  8. country: { name: string, dialCode: string, code: string },
  9. /**
  10. * Click handler for the selector.
  11. */
  12. onClick: Function,
  13. };
  14. /**
  15. * This component displays the country selector with the flag.
  16. *
  17. * @returns {ReactElement}
  18. */
  19. function CountrySelector({ country: { code, dialCode }, onClick }: Props) {
  20. return (
  21. <div
  22. className = 'cpick-selector'
  23. onClick = { onClick }>
  24. <div className = { `prejoin-dialog-flag iti-flag ${code}` } />
  25. <span>{`+${dialCode}`}</span>
  26. <Icon
  27. className = 'cpick-icon'
  28. size = { 16 }
  29. src = { IconArrowDown } />
  30. </div>
  31. );
  32. }
  33. export default CountrySelector;