From 361d924c11449abf9f64c7eb2e4a8fcf93e0864f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Mon, 16 Mar 2020 14:13:04 +0100 Subject: [PATCH] Fix layout issues after merges (https://github.com/woocommerce/woocommerce-blocks/pull/1968) * Fix address form layout broken because select was occupying too much space * Fix shipping rates appearing in the Checkout sidebar * Center button text --- .../cart-checkout/button/style.scss | 6 +- .../js/base/components/select/style.scss | 1 + .../totals/totals-shipping-item/index.js | 27 ++++----- .../shipping-rate-selector.js | 6 +- .../totals/totals-shipping-item/style.scss | 56 +++++++++++++++++++ .../cart-checkout/cart/full-cart/style.scss | 53 ------------------ .../js/blocks/cart-checkout/checkout/block.js | 1 - .../blocks/cart-checkout/checkout/sidebar.js | 6 +- 8 files changed, 78 insertions(+), 78 deletions(-) create mode 100644 plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/style.scss diff --git a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/button/style.scss b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/button/style.scss index 22fc8e2d0fc..3324cb7356a 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/button/style.scss +++ b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/button/style.scss @@ -2,14 +2,16 @@ .wc-block-cart, .wc-block-checkout { .button.wc-block-button { + align-items: center; background-color: #000 !important; color: #fff !important; - display: block; + display: flex; font-size: inherit; font-weight: bold; height: 48px; // same height as text-input + justify-content: center; line-height: 1; - padding: $gap-small; + padding: 0 $gap-small; text-align: center; text-decoration: none; text-transform: none; diff --git a/plugins/woocommerce-blocks/assets/js/base/components/select/style.scss b/plugins/woocommerce-blocks/assets/js/base/components/select/style.scss index 2d08a431be0..3ff537591ce 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/select/style.scss +++ b/plugins/woocommerce-blocks/assets/js/base/components/select/style.scss @@ -1,4 +1,5 @@ .wc-block-select { + height: 48px; position: relative; margin-top: $gap; diff --git a/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/index.js b/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/index.js index 348f86c8664..e872048e9af 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/index.js +++ b/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/index.js @@ -15,6 +15,7 @@ import { useShippingRates } from '@woocommerce/base-hooks'; import TotalsItem from '../totals-item'; import ShippingRateSelector from './shipping-rate-selector'; import hasShippingRate from './has-shipping-rate'; +import './style.scss'; /** * Renders the shipping totals row, rates, and calculator if enabled. @@ -22,6 +23,7 @@ import hasShippingRate from './has-shipping-rate'; const TotalsShippingItem = ( { currency, values, + isCheckout = false, showCalculator = true, showRatesWithoutAddress = false, } ) => { @@ -44,14 +46,14 @@ const TotalsShippingItem = ( { const showingRates = showRatesWithoutAddress || hasShippingAddress; // If we have no rates, and an address is needed. - if ( ! hasRates && ! hasShippingAddress ) { + if ( ! hasRates && ! hasShippingAddress && ! isCheckout ) { return ( { setIsShippingCalculatorOpen( ! isShippingCalculatorOpen @@ -100,7 +102,7 @@ const TotalsShippingItem = ( { { ' ' } { showCalculator && (