Skip to content

Commit

Permalink
Merge pull request #20 from gthomas-appfolio/cleanUpSomeLint
Browse files Browse the repository at this point in the history
ap - fix some lint errors
  • Loading branch information
Aaron Panchal authored Oct 13, 2016
2 parents ee60cc7 + 460c708 commit dde4001
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
21 changes: 11 additions & 10 deletions src/components/FormChoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ const FormChoice = props => {
...attributes
} = props;

const labelClasses = classname({ 'form-check-inline': inline })
, item = (
<Label className={labelClasses} check={!inline}>
<Input type={type} {...attributes} disabled={disabled} />
<span children={children} />
</Label>
);
const labelClasses = classname({ 'form-check-inline': inline });
const item = (
<Label className={labelClasses} check={!inline}>
<Input type={type} {...attributes} disabled={disabled} />
<span children={children} />
</Label>
);

if (type === 'select') {
return <option {...attributes} children={children} />
return <option {...attributes} children={children} />;
} else if (inline) {
return item;
} else {
Expand All @@ -31,9 +31,10 @@ const FormChoice = props => {
check
color={color || state}
disabled={disabled}
children={item} />
children={item}
/>
);
}
}
};

export default FormChoice;
15 changes: 9 additions & 6 deletions src/components/FormRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ const FormRow = props => {
...attributes
}));
} else if (type === 'static') {
content = <Input static
content = (
<Input
static
id={id}
children={props.value || props.defaultValue}
size={size}
state={color || state}
{...attributes}
/>
);
} else {
const InputElement = (typeof type === 'string') ? Input : type;
content = (
Expand All @@ -50,13 +53,13 @@ const FormRow = props => {
return (
<FormGroup row color={color || state}>
<Label for={id} sm={3} size={size}>
{ label }
{ required && label ? <span className="text-danger"> *</span> : null }
{label}
{required && label ? <span className="text-danger"> *</span> : null}
</Label>
<Col sm={9}>
{ content }
{ hint ? <FormText color="muted" children={hint} /> : null }
{ feedback ? <FormFeedback children={feedback} /> : null }
{content}
{hint ? <FormText color="muted" children={hint} /> : null}
{feedback ? <FormFeedback children={feedback} /> : null}
</Col>
</FormGroup>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/PatternInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ const PatternInput = ({ pattern, ...props }) => (
<Input {...props} onKeyPress={pattern ? e => restrictKeystrokeTo(e, pattern) : null} />
);

PatternInput.propTypes = {
pattern: React.PropTypes.object
}

export default PatternInput;

0 comments on commit dde4001

Please sign in to comment.