Multiple UI fixes (#3357)
* Multiple UI fixes * Removing utils from tutorial file
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
ca138883ab
Коммит
b130a32eac
@@ -8,6 +8,7 @@ export default class FormError extends React.Component {
|
||||
// accepts either a single error or an array of errors
|
||||
return {
|
||||
error: React.PropTypes.node,
|
||||
noMargin: React.PropTypes.node,
|
||||
errors: React.PropTypes.arrayOf(React.PropTypes.node)
|
||||
};
|
||||
}
|
||||
@@ -26,6 +27,7 @@ export default class FormError extends React.Component {
|
||||
|
||||
// look for the first truthy error to display
|
||||
let message = this.props.error;
|
||||
const noMargin = this.props.noMargin;
|
||||
|
||||
if (!message) {
|
||||
for (const error of this.props.errors) {
|
||||
@@ -39,6 +41,16 @@ export default class FormError extends React.Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (noMargin) {
|
||||
return (
|
||||
<div className='has-error'>
|
||||
<label className='control-label'>
|
||||
{message}
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='form-group has-error'>
|
||||
<label className='control-label'>
|
||||
|
||||
Ссылка в новой задаче
Block a user