mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
pass disabled prop to formik-select
This commit is contained in:
parent
7a4925ddba
commit
bca11b1191
2 changed files with 4 additions and 4 deletions
|
@ -17,6 +17,7 @@ const FormikSelect = ({
|
||||||
}) => {
|
}) => {
|
||||||
const optionsList = options.map((item, index) => (
|
const optionsList = options.map((item, index) => (
|
||||||
<option
|
<option
|
||||||
|
disabled={item.disabled}
|
||||||
key={index}
|
key={index}
|
||||||
value={item.value}
|
value={item.value}
|
||||||
>
|
>
|
||||||
|
|
|
@ -12,16 +12,15 @@ const JoinFlowStep = require('./join-flow-step.jsx');
|
||||||
require('./join-flow-steps.scss');
|
require('./join-flow-steps.scss');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of options to give to select
|
* Return a list of country options to give to select
|
||||||
* @param {object} reactIntl react-intl, used to localize strings
|
* @param {object} reactIntl react-intl, used to localize strings
|
||||||
* @param {string} defaultCountry optional string of default country to put at top of list
|
* @return {object} ordered set of county options select
|
||||||
* @return {object} ordered set of county options formatted for frc select
|
|
||||||
*/
|
*/
|
||||||
const getCountryOptions = reactIntl => {
|
const getCountryOptions = reactIntl => {
|
||||||
const processedCountryData = countryData.registrationCountryOptions;
|
const processedCountryData = countryData.registrationCountryOptions;
|
||||||
processedCountryData.unshift({
|
processedCountryData.unshift({
|
||||||
label: reactIntl.formatMessage({id: 'registration.selectCountry'}),
|
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
label: reactIntl.formatMessage({id: 'registration.selectCountry'}),
|
||||||
value: 'null'
|
value: 'null'
|
||||||
});
|
});
|
||||||
return processedCountryData;
|
return processedCountryData;
|
||||||
|
|
Loading…
Reference in a new issue