diff --git a/.eslintrc b/.eslintrc index 239d4b37d..c5b26de1b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -73,12 +73,12 @@ "prop": "parens" }], "react/jsx-boolean-value": ["error", "always"], - "react/jsx-closing-tag-location": ["warn"], + "react/jsx-closing-tag-location": ["error"], "react/jsx-curly-spacing": ["error", "never"], "react/jsx-equals-spacing": ["warn", "never"], - "react/jsx-first-prop-new-line": ["warn", "multiline-multiprop"], + "react/jsx-first-prop-new-line": ["error", "multiline-multiprop"], "react/jsx-handler-names": ["warn"], - "react/jsx-indent": ["warn", 2], + "react/jsx-indent": ["error", 2], "react/jsx-indent-props": ["warn", 2], "react/jsx-key": ["warn"], "react/jsx-max-depth": ["warn", { "max": 2}], diff --git a/src/webui/components/Login/index.js b/src/webui/components/Login/index.js index b203d9126..d32f904ff 100644 --- a/src/webui/components/Login/index.js +++ b/src/webui/components/Login/index.js @@ -99,28 +99,33 @@ export default class LoginModal extends Component { }); } + renderMessage(title, description) { + const errorMessage = ( + +
+ + {title} + +
+
+ {description} +
+
); + + return ( +
+ + {errorMessage()} +
); + } + renderLoginError({ type, title, description } = {}) { return type === 'error' && ( - - -
- - {title} - -
-
- {description} -
-
- ) - } + message={this.renderMessage(title, description)} /> ); } diff --git a/test/unit/webui/components/package.spec.js b/test/unit/webui/components/package.spec.js index cddc9deb7..807322889 100644 --- a/test/unit/webui/components/package.spec.js +++ b/test/unit/webui/components/package.spec.js @@ -51,9 +51,7 @@ describe(' component', () => { expect(wrapper.find(Field).someWhere(n => { return ( n.children().first().get(0).props.children[0].props.text === 'Description' && - n.children().childAt(1).containsMatchingElement( - {props.description} - ) + n.children().childAt(1).containsMatchingElement({props.description}) ) })).toBe(true);