fix eslint errors

This commit is contained in:
John Mitchell
2018-10-24 21:51:35 -04:00
parent 2245d6a22e
commit 1caa5b1c54
3 changed files with 17 additions and 16 deletions

View File

@@ -4,19 +4,20 @@ import {
Redirect Redirect
} from 'react-router-dom'; } from 'react-router-dom';
const ConditionalRedirect = ({ component: Component, shouldRedirect, redirectPath, ...props }) => { const ConditionalRedirect = ({
if (shouldRedirect()) { component: Component,
return ( shouldRedirect,
<Redirect to={{ redirectPath,
pathname: redirectPath, location,
state: { from: props.location } ...props
}}/> }) => (shouldRedirect() ? (
); <Redirect to={{
} else { pathname: redirectPath,
return ( state: { from: location }
<Route {...props} render={props => (<Component {...props}/>)} /> }}
); />
} ) : (
}; <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} onChange={this.handleUsernameChange}
/> />
</div> </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"> <label className="pf-c-form__label" htmlFor="pw">
Password Password
<span className="pf-c-form__label__required" aria-hidden="true">&#42;</span> <span className="pf-c-form__label__required" aria-hidden="true">&#42;</span>