From 20be659cef7be3f381b55829198d3844bb7fffbb Mon Sep 17 00:00:00 2001 From: Justin Shreve Date: Mon, 4 Nov 2019 11:34:44 -0500 Subject: [PATCH] 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 --- .../dashboard/profile-wizard/header-logo.js | 214 +++++++++++------- .../dashboard/profile-wizard/style.scss | 6 +- 2 files changed, 131 insertions(+), 89 deletions(-) diff --git a/plugins/woocommerce-admin/client/dashboard/profile-wizard/header-logo.js b/plugins/woocommerce-admin/client/dashboard/profile-wizard/header-logo.js index 4e3571e2968..a750830d70f 100644 --- a/plugins/woocommerce-admin/client/dashboard/profile-wizard/header-logo.js +++ b/plugins/woocommerce-admin/client/dashboard/profile-wizard/header-logo.js @@ -1,93 +1,131 @@ /** @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 ( + + + + + { ! isJetpackConnected && ( + + + + + + + + ) } + + + + + - + { ! isJetpackConnected && ( + + + + + + ) } + - - - - - - - - - - - - - - -); + + ); + } +} + +export default compose( + withSelect( select => { + const { isJetpackConnected } = select( 'wc-api' ); + return { + isJetpackConnected: isJetpackConnected(), + }; + } ) +)( HeaderLogo ); diff --git a/plugins/woocommerce-admin/client/dashboard/profile-wizard/style.scss b/plugins/woocommerce-admin/client/dashboard/profile-wizard/style.scss index 3e5c58da088..9e577569ae1 100644 --- a/plugins/woocommerce-admin/client/dashboard/profile-wizard/style.scss +++ b/plugins/woocommerce-admin/client/dashboard/profile-wizard/style.scss @@ -57,7 +57,11 @@ justify-content: center; 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%); }