summaryrefslogtreecommitdiffstats
path: root/webapp/components/form_error.jsx
diff options
context:
space:
mode:
authorAsaad Mahmood <asaadmahmoodspin@users.noreply.github.com>2016-06-16 22:20:43 +0500
committerCorey Hulen <corey@hulen.com>2016-06-16 09:20:43 -0800
commitb130a32eaccb6f46ad90eb252291b8376435fb60 (patch)
treea1e466c7799e220adb828ec2e3d748056d2c7be4 /webapp/components/form_error.jsx
parentca138883ab5416706ee3eea866640add338c11f9 (diff)
downloadchat-b130a32eaccb6f46ad90eb252291b8376435fb60.tar.gz
chat-b130a32eaccb6f46ad90eb252291b8376435fb60.tar.bz2
chat-b130a32eaccb6f46ad90eb252291b8376435fb60.zip
Multiple UI fixes (#3357)
* Multiple UI fixes * Removing utils from tutorial file
Diffstat (limited to 'webapp/components/form_error.jsx')
-rw-r--r--webapp/components/form_error.jsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/webapp/components/form_error.jsx b/webapp/components/form_error.jsx
index b7d1de16a..395adfaab 100644
--- a/webapp/components/form_error.jsx
+++ b/webapp/components/form_error.jsx
@@ -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'>