fix eslint errors

This commit is contained in:
John Mitchell 2018-10-24 21:51:35 -04:00
parent 2245d6a22e
commit 1caa5b1c54
No known key found for this signature in database
GPG Key ID: FE6A9B5BD4EB5C94
3 changed files with 17 additions and 16 deletions

View File

@ -4,19 +4,20 @@ import {
Redirect
} from 'react-router-dom';
const ConditionalRedirect = ({ component: Component, shouldRedirect, redirectPath, ...props }) => {
if (shouldRedirect()) {
return (
<Redirect to={{
pathname: redirectPath,
state: { from: props.location }
}}/>
);
} else {
return (
<Route {...props} render={props => (<Component {...props}/>)} />
);
}
};
const ConditionalRedirect = ({
component: Component,
shouldRedirect,
redirectPath,
location,
...props
}) => (shouldRedirect() ? (
<Redirect to={{
pathname: redirectPath,
state: { from: location }
}}
/>
) : (
<Route {...props} render={rest => (<Component {...rest} />)} />
));
export default ConditionalRedirect;
export default ConditionalRedirect;

View File

@ -97,7 +97,7 @@ class LoginPage extends Component {
onChange={this.handleUsernameChange}
/>
</div>
<div className="pf-c-form__group" id="password">>
<div className="pf-c-form__group" id="password">
<label className="pf-c-form__label" htmlFor="pw">
Password
<span className="pf-c-form__label__required" aria-hidden="true">&#42;</span>