Skip to content

Commit

Permalink
refactor login error message into its own constant
Browse files Browse the repository at this point in the history
for readability, prompted by line length complaint from linter
  • Loading branch information
jmartin-sul committed Aug 28, 2020
1 parent 993ee87 commit c99b3f0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/home/LoginPanel.jsx
Expand Up @@ -96,9 +96,18 @@ class LoginPanel extends Component {
</React.Fragment>
)

const loginErrorMessageElement = (
<React.Fragment>
{
authenticationError
&& <div className="alert alert-danger alert-dismissible" role="alert" aria-label={ authenticationError.message }>{ authenticationError.message }</div>
}
</React.Fragment>
)

return (
<React.Fragment>
{ authenticationError && <div className="alert alert-danger alert-dismissible" role="alert" aria-label={ authenticationError.message }>{ authenticationError.message }</div> }
{ loginErrorMessageElement }
<form className="login-form" onSubmit={this.handleLoginSubmit}>
{ !currentSession && inlineLoginForm }
</form>
Expand Down

0 comments on commit c99b3f0

Please sign in to comment.