2020-02-17 11:12:15 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import ShippingCalculatorAddress from './address';
|
|
|
|
import './style.scss';
|
|
|
|
|
2020-03-13 13:41:59 +00:00
|
|
|
const ShippingCalculator = ( { onUpdate, address, addressFields } ) => {
|
2020-02-17 11:12:15 +00:00
|
|
|
return (
|
2020-03-13 13:41:59 +00:00
|
|
|
<div className="wc-block-cart__shipping-calculator">
|
|
|
|
<ShippingCalculatorAddress
|
|
|
|
address={ address }
|
|
|
|
addressFields={ addressFields }
|
|
|
|
onUpdate={ ( newAddress ) => {
|
|
|
|
onUpdate( newAddress );
|
2020-02-17 11:12:15 +00:00
|
|
|
} }
|
2020-03-13 13:41:59 +00:00
|
|
|
/>
|
|
|
|
</div>
|
2020-02-17 11:12:15 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ShippingCalculator.propTypes = {
|
2020-03-13 13:41:59 +00:00
|
|
|
onUpdate: PropTypes.func.isRequired,
|
|
|
|
address: PropTypes.object.isRequired,
|
|
|
|
addressFields: PropTypes.array.isRequired,
|
2020-02-17 11:12:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ShippingCalculator;
|