ES6 assets/js/src/form/fields/radio.jsx
This commit is contained in:
@@ -1,10 +1,6 @@
|
|||||||
define([
|
import React from 'react';
|
||||||
'react',
|
|
||||||
],
|
const FormFieldRadio = React.createClass({
|
||||||
(
|
|
||||||
React
|
|
||||||
) => {
|
|
||||||
const FormFieldRadio = React.createClass({
|
|
||||||
render: function render() {
|
render: function render() {
|
||||||
if (this.props.field.values === undefined) {
|
if (this.props.field.values === undefined) {
|
||||||
return false;
|
return false;
|
||||||
@@ -12,8 +8,8 @@ define([
|
|||||||
|
|
||||||
const selectedValue = this.props.item[this.props.field.name];
|
const selectedValue = this.props.item[this.props.field.name];
|
||||||
const options = Object.keys(this.props.field.values).map(
|
const options = Object.keys(this.props.field.values).map(
|
||||||
(value, index) => (
|
value => (
|
||||||
<p key={`radio-${index}`}>
|
<p key={`radio-${value}`}>
|
||||||
<label htmlFor={this.props.field.name}>
|
<label htmlFor={this.props.field.name}>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
@@ -35,7 +31,6 @@ define([
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
|
||||||
|
|
||||||
return FormFieldRadio;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default FormFieldRadio;
|
||||||
|
Reference in New Issue
Block a user