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

This commit is contained in:
Oliver Eyton-Williams
2020-08-25 19:29:39 +02:00
committed by GitHub
parent 6579b502fd
commit 46e3d75c76

View File

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