Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit a089b05

Browse files
nerradmikejolley
authored andcommitted
move shipping-rates-control and shipping totals back into base/components/cart-checkout
1 parent 1d7fdc4 commit a089b05

File tree

13 files changed

+16
-22
lines changed

13 files changed

+16
-22
lines changed

assets/js/base/components/cart-checkout/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export { default as ProductSaleBadge } from './product-sale-badge';
1313
export { default as ReturnToCartButton } from './return-to-cart-button';
1414
export { default as ShippingCalculator } from './shipping-calculator';
1515
export { default as ShippingLocation } from './shipping-location';
16+
export { default as ShippingRatesControl } from './shipping-rates-control';
1617
export { default as PaymentMethodIcons } from './payment-method-icons';
1718
export { default as PaymentMethodLabel } from './payment-method-label';
1819
export * from './totals';

packages/checkout/shipping/shipping-rates-control/shipping-rates-control.js renamed to assets/js/base/components/cart-checkout/shipping-rates-control/index.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,22 @@ import { useEffect } from '@wordpress/element';
66
import PropTypes from 'prop-types';
77
import { speak } from '@wordpress/a11y';
88
import LoadingMask from '@woocommerce/base-components/loading-mask';
9+
import {
10+
ShippingRatesControlPackage,
11+
ExperimentalOrderShippingPackages,
12+
} from '@woocommerce/blocks-checkout';
913
import {
1014
getShippingRatesPackageCount,
1115
getShippingRatesRateCount,
1216
} from '@woocommerce/base-utils';
1317

14-
/**
15-
* Internal dependencies
16-
*/
17-
import Package from './package';
18-
import ExperimentalOrderShippingPackages from '../../order-shipping-packages';
19-
import './style.scss';
20-
2118
/**
2219
* @typedef {import('react')} React
2320
*/
2421

2522
/**
2623
* Renders the shipping rates control element.
2724
*
28-
* @todo Move ShippingRatesControl, TotalsShipping, and ShippingRateSelector to our base components folder.
29-
* they're too coupled with our base implementation to be exported and we should only export Package.
30-
*
3125
* @param {Object} props Incoming props.
3226
* @param {Array} props.shippingRates Array of packages containing shipping rates.
3327
* @param {boolean} props.shippingRatesLoading True when rates are being loaded.
@@ -147,7 +141,7 @@ const Packages = ( {
147141
}
148142

149143
return packages.map( ( { package_id: packageId, ...packageData } ) => (
150-
<Package
144+
<ShippingRatesControlPackage
151145
key={ packageId }
152146
packageId={ packageId }
153147
packageData={ packageData }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export { default as TotalsCoupon } from './coupon';
22
export { default as TotalsDiscount } from './discount';
33
export { default as TotalsFooterItem } from './footer-item';
4+
export { default as TotalsShipping } from './shipping';

packages/checkout/totals/shipping/has-shipping-rate.js renamed to assets/js/base/components/cart-checkout/totals/shipping/has-shipping-rate.js

File renamed without changes.

packages/checkout/totals/shipping/index.js renamed to assets/js/base/components/cart-checkout/totals/shipping/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import {
1111
ShippingCalculator,
1212
ShippingLocation,
1313
} from '@woocommerce/base-components/cart-checkout';
14+
import { TotalsItem } from '@woocommerce/blocks-checkout';
1415

1516
/**
1617
* Internal dependencies
1718
*/
18-
import TotalsItem from '../item';
1919
import ShippingRateSelector from './shipping-rate-selector';
2020
import hasShippingRate from './has-shipping-rate';
2121
import './style.scss';

packages/checkout/totals/shipping/shipping-rate-selector.js renamed to assets/js/base/components/cart-checkout/totals/shipping/shipping-rate-selector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import classnames from 'classnames';
88
/**
99
* Internal dependencies
1010
*/
11-
import { ShippingRatesControl } from '../../shipping';
11+
import ShippingRatesControl from '../../shipping-rates-control';
1212

1313
const ShippingRateSelector = ( {
1414
hasRates,

packages/checkout/totals/shipping/stories/index.js renamed to assets/js/base/components/cart-checkout/totals/shipping/stories/index.js

File renamed without changes.

packages/checkout/totals/shipping/style.scss renamed to assets/js/base/components/cart-checkout/totals/shipping/style.scss

File renamed without changes.

assets/js/blocks/cart-checkout/cart/full-cart/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
TotalsCoupon,
99
TotalsDiscount,
1010
TotalsFooterItem,
11+
TotalsShipping,
1112
} from '@woocommerce/base-components/cart-checkout';
1213
import {
1314
Subtotal,
1415
TotalsFees,
1516
TotalsTaxes,
16-
TotalsShipping,
1717
ExperimentalOrderMeta,
1818
getCurrencyFromPriceResponse,
1919
} from '@woocommerce/blocks-checkout';

assets/js/blocks/cart-checkout/checkout/form/shipping-options-step.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
* External dependencies
33
*/
44
import { __ } from '@wordpress/i18n';
5-
import { FormStep } from '@woocommerce/base-components/cart-checkout';
5+
import {
6+
FormStep,
7+
ShippingRatesControl,
8+
} from '@woocommerce/base-components/cart-checkout';
69
import {
710
getShippingRatesPackageCount,
811
getShippingRatesRateCount,
912
} from '@woocommerce/base-utils';
10-
import {
11-
getCurrencyFromPriceResponse,
12-
ShippingRatesControl,
13-
} from '@woocommerce/blocks-checkout';
13+
import { getCurrencyFromPriceResponse } from '@woocommerce/blocks-checkout';
1414
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
1515
import {
1616
useCheckoutContext,

0 commit comments

Comments
 (0)