2020-05-14 12:30:24 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2022-10-28 10:07:58 +00:00
|
|
|
import { countries } from '../../../utils';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2020-05-14 12:30:24 +00:00
|
|
|
import CountryRow from './CountryRow';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Click handler for a single entry.
|
|
|
|
*/
|
|
|
|
onEntryClick: Function,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This component displays the dropdown for the country picker.
|
|
|
|
*
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
function CountryDropdown({ onEntryClick }: Props) {
|
|
|
|
return (
|
|
|
|
<div className = 'cpick-dropdown'>
|
|
|
|
{countries.map(country => (
|
|
|
|
<CountryRow
|
|
|
|
country = { country }
|
|
|
|
key = { `${country.code}` }
|
|
|
|
onEntryClick = { onEntryClick } />
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default CountryDropdown;
|