Only show the Jetpack logo in the header if we need to setup Jetpack (https://github.com/woocommerce/woocommerce-admin/pull/3160)

* Only show the Jetpack logo in the header if we need to setup Jetpack

* Adjust woo logo position
This commit is contained in:
Justin Shreve 2019-11-04 11:34:44 -05:00 committed by GitHub
parent 4a59cb9b09
commit 20be659cef
2 changed files with 131 additions and 89 deletions

View File

@ -1,18 +1,42 @@
/** @format */ /** @format */
/**
* External dependencies
*/
import { Component } from '@wordpress/element';
import { compose } from '@wordpress/compose';
import classNames from 'classnames';
export default () => ( /**
* Internal depdencies
*/ import withSelect from 'wc-api/with-select';
class HeaderLogo extends Component {
render() {
const { isJetpackConnected } = this.props;
const ariaLabel = ! isJetpackConnected ? 'Jetpack + WooCommerce' : 'WooCommerce';
const classes = classNames( 'woocommerce-profile-wizard__header-logo', {
'woocommerce-profile-wizard__header-logo-with-jetpack': ! isJetpackConnected,
} );
return (
<svg <svg
role="img" role="img"
aria-label="Jetpack + Woo" aria-label={ ariaLabel }
width="200" width="200"
viewBox="0 0 1270 170" viewBox="0 0 1270 170"
version="1.1" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
className={ classes }
> >
<g fill="none" fillRule="evenodd"> <g fill="none" fillRule="evenodd">
<g> <g>
<g> <g>
<g transform="translate(219 35.082353)" className="woocommerce-profile-wizard__plus"> { ! isJetpackConnected && (
<g
transform="translate(219 35.082353)"
className="woocommerce-profile-wizard__plus"
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@ -25,6 +49,7 @@ export default () => (
</g> </g>
</svg> </svg>
</g> </g>
) }
<g fillRule="nonzero" transform="translate(360)"> <g fillRule="nonzero" transform="translate(360)">
<path <path
d="M23.7,0.2 L222.8,0.2 C235.4,0.2 245.6,10.4 245.6,23 d="M23.7,0.2 L222.8,0.2 C235.4,0.2 245.6,10.4 245.6,23
@ -78,6 +103,7 @@ export default () => (
fillRule="nonzero" fillRule="nonzero"
/> />
</g> </g>
{ ! isJetpackConnected && (
<svg height="150" width="150" viewBox="0 0 32 32"> <svg height="150" width="150" viewBox="0 0 32 32">
<path <path
fill="#2B2D2F" fill="#2B2D2F"
@ -86,8 +112,20 @@ export default () => (
<polygon fill="#F6F6F6" points="15,19 7,19 15,3 " /> <polygon fill="#F6F6F6" points="15,19 7,19 15,3 " />
<polygon fill="#F6F6F6" points="17,29 17,13 25,13 " /> <polygon fill="#F6F6F6" points="17,29 17,13 25,13 " />
</svg> </svg>
) }
</g> </g>
</g> </g>
</g> </g>
</svg> </svg>
); );
}
}
export default compose(
withSelect( select => {
const { isJetpackConnected } = select( 'wc-api' );
return {
isJetpackConnected: isJetpackConnected(),
};
} )
)( HeaderLogo );

View File

@ -57,7 +57,11 @@
justify-content: center; justify-content: center;
background: $studio-white; background: $studio-white;
svg > g { svg.woocommerce-profile-wizard__header-logo > g {
transform: translateX(12%);
}
svg.woocommerce-profile-wizard__header-logo-with-jetpack > g {
transform: translateX(25%); transform: translateX(25%);
} }