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

Commit

Permalink
Use LocalPickupSelect component when rendering local pickup options
Browse files Browse the repository at this point in the history
  • Loading branch information
opr committed Mar 3, 2023
1 parent f2dae18 commit dfea41a
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-mone
import { decodeEntities } from '@wordpress/html-entities';
import { getSetting } from '@woocommerce/settings';
import { Icon, mapMarker } from '@wordpress/icons';
import RadioControl from '@woocommerce/base-components/radio-control';
import type { RadioControlOption } from '@woocommerce/base-components/radio-control/types';
import { CartShippingPackageShippingRate } from '@woocommerce/types';
import { isPackageRateCollectable } from '@woocommerce/base-utils';
import { ExperimentalOrderLocalPickupPackages } from '@woocommerce/blocks-checkout';
import { LocalPickupSelect } from '@woocommerce/base-components/cart-checkout/local-pickup-select';

/**
* Internal dependencies
Expand Down Expand Up @@ -144,7 +144,7 @@ const Block = (): JSX.Element | null => {
cart,
components: {
ShippingRatesControlPackage,
RadioControl,
LocalPickupSelect,
},
renderPickupLocation,
};
Expand All @@ -161,15 +161,13 @@ const Block = (): JSX.Element | null => {
<>
<ExperimentalOrderLocalPickupPackages.Slot { ...slotFillProps } />
<ExperimentalOrderLocalPickupPackages>
<RadioControl
onChange={ ( value: string ) => {
setSelectedOption( value );
onSelectRate( value );
} }
selected={ selectedOption }
options={ pickupLocations.map( ( location ) =>
renderPickupLocation( location, shippingRates.length )
) }
<LocalPickupSelect
title={ shippingRates[ 0 ].name }
setSelectedOption={ setSelectedOption }
onSelectRate={ onSelectRate }
selectedOption={ selectedOption }
renderPickupLocation={ renderPickupLocation }
pickupLocations={ pickupLocations }
/>
</ExperimentalOrderLocalPickupPackages>
</>
Expand Down

0 comments on commit dfea41a

Please sign in to comment.