diff --git a/src/webui/components/Login/index.js b/src/webui/components/Login/index.js
index 552cd79f8..00e16f1bc 100644
--- a/src/webui/components/Login/index.js
+++ b/src/webui/components/Login/index.js
@@ -137,6 +137,56 @@ export default class LoginModal extends Component {
);
}
+ renderNameField = () => {
+ const { form: { username } } = this.state;
+ return (
+
+ Username
+
+ {!username.value && !username.pristine && (
+
+ {username.helperText}
+
+ )}
+
+ );
+ }
+
+ renderPasswordField = () => {
+ const { form: { password } } = this.state;
+ return (
+
+ Password
+
+ {!password.value && !password.pristine && (
+
+ {password.helperText}
+
+ )}
+
+ );
+ }
+
render() {
const { visibility, onCancel, error } = this.props;
const { form: { username, password } } = this.state;
@@ -152,44 +202,8 @@ export default class LoginModal extends Component {
Login
{this.renderLoginError(error)}
-
- Username
-
- {!username.value && !username.pristine && (
-
- {username.helperText}
-
- )}
-
-
- Password
-
- {!password.value && !password.pristine && (
-
- {password.helperText}
-
- )}
-
+ {this.renderNameField()}
+ {this.renderPasswordField()}