提交 765004d9 编写于 作者: M Maxime Beauchemin

Moving ControlLabelWithTooltip where it belongs

上级 c2e8c4f6
import React, { PropTypes } from 'react';
import { Checkbox } from 'react-bootstrap';
import ControlLabelWithTooltip from './ControlLabelWithTooltip';
const propTypes = {
name: PropTypes.string.isRequired,
......@@ -27,9 +26,7 @@ export default class CheckboxField extends React.Component {
inline
checked={this.props.value}
onChange={this.onToggle.bind(this)}
>
<ControlLabelWithTooltip label={this.props.label} description={this.props.description} />
</Checkbox>
/>
);
}
}
......
......@@ -4,6 +4,8 @@ import CheckboxField from './CheckboxField';
import TextAreaField from './TextAreaField';
import SelectField from './SelectField';
import ControlLabelWithTooltip from './ControlLabelWithTooltip';
const fieldMap = {
TextField,
CheckboxField,
......@@ -38,6 +40,7 @@ export default class FieldSet extends React.Component {
const FieldClass = fieldMap[this.props.type];
return (
<div>
<ControlLabelWithTooltip label={this.props.label} description={this.props.description} />
<FieldClass {...this.props} />
</div>
);
......
import React, { PropTypes } from 'react';
import ControlLabelWithTooltip from './ControlLabelWithTooltip';
import { slugify } from '../../modules/utils';
import Select, { Creatable } from 'react-select';
......@@ -99,7 +98,7 @@ export default class SelectField extends React.Component {
);
}
return (
<div>
<div id={`formControlsSelect-${slugify(this.props.label)}`}>
{selectWrap}
</div>
);
......
import React, { PropTypes } from 'react';
import { FormGroup, FormControl } from 'react-bootstrap';
import ControlLabelWithTooltip from './ControlLabelWithTooltip';
const propTypes = {
name: PropTypes.string.isRequired,
......@@ -24,7 +23,6 @@ export default class TextAreaField extends React.Component {
render() {
return (
<FormGroup controlId="formControlsTextarea">
<ControlLabelWithTooltip label={this.props.label} description={this.props.description} />
<FormControl
componentClass="textarea"
placeholder="textarea"
......
import React, { PropTypes } from 'react';
import { FormGroup, FormControl } from 'react-bootstrap';
import ControlLabelWithTooltip from './ControlLabelWithTooltip';
const propTypes = {
name: PropTypes.string.isRequired,
......@@ -24,10 +23,6 @@ export default class TextField extends React.Component {
render() {
return (
<FormGroup controlId="formInlineName" bsSize="small">
<ControlLabelWithTooltip
label={this.props.label}
description={this.props.description}
/>
<FormControl
type="text"
placeholder=""
......
......@@ -19,3 +19,9 @@
padding: 0 0 0 .5em;
font-size: 14px;
}
.checkbox {
float: left;
margin-top: 0px;
margin-right: 3px;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册