mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
fixed country options
This commit is contained in:
parent
fdbbc5e632
commit
f26a83423c
1 changed files with 12 additions and 10 deletions
|
@ -1060,23 +1060,25 @@ const dupeCommonCountries = module.exports.dupeCommonCountries = (startingCountr
|
|||
|
||||
/*
|
||||
* registrationCountryOptions is the result of taking the standard countryInfo,
|
||||
* and duplicating 'United States of America' and 'United Kingdom' at the top of the list.
|
||||
* setting a 'value' key and a 'label' key both to the country data's 'name' value,
|
||||
* but using the 'display' value for 'label' instead of 'name' if 'display' exists;
|
||||
* then duplicating 'United States of America' and 'United Kingdom' at the top of the list.
|
||||
* The result is an array like:
|
||||
* [
|
||||
* {code: 'us', name: 'United States', display: 'United States of America'},
|
||||
* {code: 'gb', name: 'United Kingdom'},
|
||||
* {code: 'af', name: 'Afghanistan'},
|
||||
* {value: 'United States', label: 'United States of America'},
|
||||
* {value: 'United Kingdom', label: 'United Kingdom'},
|
||||
* {value: 'Afghanistan', label: 'Afghanistan'},
|
||||
* ...
|
||||
* {code: 'ae', name: 'United Arab Emirates'},
|
||||
* {code: 'us', name: 'United States', display: 'United States of America'},
|
||||
* {code: 'gb', name: 'United Kingdom'},
|
||||
* {code: 'uz', name: 'Uzbekistan'},
|
||||
* {value: 'United Arab Emirates', label: 'United Arab Emirates'},
|
||||
* {value: 'United States', label: 'United States of America'},
|
||||
* {value: 'United Kingdom', label: 'United Kingdom'},
|
||||
* {value: 'Uzbekistan', label: 'Uzbekistan'},
|
||||
* ...
|
||||
* {code: 'zm', name: 'Zimbabwe'}
|
||||
* {value: 'Zimbabwe', label: 'Zimbabwe'}
|
||||
* ]
|
||||
*/
|
||||
module.exports.registrationCountryOptions =
|
||||
countryOptions(dupeCommonCountries(countryInfo, ['us', 'gb']), 'code');
|
||||
countryOptions(dupeCommonCountries(countryInfo, ['us', 'gb']), 'name');
|
||||
|
||||
/* subdivisionOptions uses iso-3166 data to produce an array like:
|
||||
* [
|
||||
|
|
Loading…
Reference in a new issue