fix(client): select only required props (Login) (#39461)

pull/39500/head
Oliver Eyton-Williams 2020-08-25 19:29:39 +02:00 committed by GitHub
parent 6579b502fd
commit 46e3d75c76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -19,15 +19,20 @@ const mapStateToProps = createSelector(
);
function Login(props) {
const { children, isSignedIn, ...restProps } = props;
const {
block,
'data-test-label': dataTestLabel,
children,
isSignedIn
} = props;
const href = isSignedIn ? '/learn' : `${apiLocation}/signin`;
return (
<Button
bsStyle='default'
className={(restProps.block ? 'btn-cta-big' : '') + ' signup-btn btn-cta'}
className={(block ? 'btn-cta-big' : '') + ' signup-btn btn-cta'}
data-test-label={dataTestLabel}
href={href}
onClick={() => gtagReportConversion()}
{...restProps}
>
{children || 'Sign In'}
</Button>
@ -36,7 +41,9 @@ function Login(props) {
Login.displayName = 'Login';
Login.propTypes = {
block: PropTypes.bool,
children: PropTypes.any,
'data-test-label': PropTypes.string,
isSignedIn: PropTypes.bool
};