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

Ensure package names display correctly if only one item is in package #6815

Merged
merged 4 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const Packages = ( {
key={ packageId }
packageId={ packageId }
packageData={ packageData }
collapsible={ collapsible }
collapse={ collapse }
collapsible={ !! collapsible }
collapse={ !! collapse }
showItems={
showItems || packageData?.shipping_rates?.length > 1
}
Expand Down Expand Up @@ -167,6 +167,7 @@ const ShippingRatesControl = ( {
ShippingRatesControlPackage,
},
context,
shippingRates,
};
const { isEditor } = useEditorContext();

Expand All @@ -192,6 +193,7 @@ const ShippingRatesControl = ( {
/>
<ExperimentalOrderShippingPackages>
<Packages
showItems={ shippingRates.length > 1 }
packages={ shippingRates }
noResultsMessage={ noResultsMessage }
renderOption={ renderOption }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ const Slot = ( {
cart,
components,
context,
shippingRates,
} ) => {
const { fills } = useSlot( slotName );
const hasMultiplePackages = fills.length > 1;
const hasMultiplePackages = fills.length > 1 || shippingRates?.length > 1;
return (
<OrderShippingPackagesSlot
className={ classnames(
Expand Down