refactoring and implementing refreshing items list every 2 seconds
This commit is contained in:
@@ -5,7 +5,7 @@ class CheckboxAndRadioWrapper extends React.Component {
|
||||
optionChange = (option, optionName, type) => {
|
||||
const optionTypePicker = {
|
||||
radio: option.target.value,
|
||||
checkbox: option.target.checked
|
||||
checkbox: option.target.checked ? option.target.value : false
|
||||
};
|
||||
const { onOptionChanged } = this.props;
|
||||
onOptionChanged({
|
||||
@@ -15,10 +15,9 @@ class CheckboxAndRadioWrapper extends React.Component {
|
||||
};
|
||||
isChecked = (type, value, optionName) => {
|
||||
const { options } = this.props;
|
||||
return type === "checkbox"
|
||||
? value
|
||||
: options.hasOwnProperty(optionName) &&
|
||||
options[optionName] === String(value);
|
||||
return options.hasOwnProperty(optionName) && type === "checkbox"
|
||||
? options[optionName]
|
||||
: options[optionName] === String(value);
|
||||
};
|
||||
renderElements = (elements, componentName) => {
|
||||
return elements.map(({ type, value, name, optionName } = {}) => (
|
||||
|
||||
Reference in New Issue
Block a user