Skip to content

Commit

Permalink
[Enhancement]: Block-based checkout - Pickup section updates (woocomm…
Browse files Browse the repository at this point in the history
…erce#47173)

* Change “Pickup options” to “Pickup locations”

* Always show pickup location and truncate pickup details

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Adjust spacing between pickup details and more link

* Hide pickup details of unselected pickup location

* Adjust line height of truncated text

* Show “Read more/less” instead of “more/less”

* Ensure both lines are equally filled with text

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
nielslange and github-actions authored May 8, 2024
1 parent 3ad9ebf commit e7aff94
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import formStepAttributes from '../../form-step/attributes';

export default {
...formStepAttributes( {
defaultTitle: __( 'Pickup options', 'woocommerce' ),
defaultTitle: __( 'Pickup locations', 'woocommerce' ),
defaultDescription: '',
} ),
className: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "woocommerce/checkout-pickup-options-block",
"version": "1.0.0",
"title": "Pickup Method",
"description": "Shows local pickup options.",
"description": "Shows local pickup locations.",
"category": "woocommerce",
"supports": {
"align": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
} from '@woocommerce/base-utils';
import { ExperimentalOrderLocalPickupPackages } from '@woocommerce/blocks-checkout';
import { LocalPickupSelect } from '@woocommerce/base-components/cart-checkout/local-pickup-select';
import ReadMore from '@woocommerce/base-components/read-more';

/**
* Internal dependencies
Expand Down Expand Up @@ -118,8 +119,7 @@ const renderPickupLocation = (
? decodeEntities( location )
: decodeEntities( option.name ),
secondaryLabel,
description: decodeEntities( details ),
secondaryDescription: address ? (
description: address ? (
<>
<Icon
icon={ mapMarker }
Expand All @@ -128,6 +128,10 @@ const renderPickupLocation = (
{ decodeEntities( address ) }
</>
) : undefined,

secondaryDescription: (
<ReadMore maxLines={ 2 }>{ decodeEntities( details ) }</ReadMore>
),
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,41 @@
margin-left: auto;
}
}
.wc-block-components-radio-control__description-group {
display: none;
}
.wc-block-components-radio-control__option-checked {
.wc-block-components-radio-control__description-group {
display: block;
}
}
.wc-block-components-radio-control__label-group {
em {
text-transform: uppercase;
font-style: inherit;
}
}

.wc-block-components-radio-control__option-checked {
.wc-block-components-radio-control__description-group {
.read-more-content {
margin-left: em($gap-small * 0.25);
position: initial;
visibility: visible;
z-index: initial;
hyphens: auto;
word-break: normal;
}
}
}

.wc-block-components-radio-control__description-group {
width: 100%;
display: block;
width: calc(100% + em($gap-huge / 0.875));
box-sizing: border-box;
background-color: $universal-background;
border-radius: $universal-border-radius;
padding: 1px em($gap-small);
margin-left: -(em($gap-huge));
margin-top: em($gap-smaller);
@include font-size(regular);

.read-more-content {
position: absolute;
visibility: hidden;
z-index: -1;
}
}
.wc-block-components-radio-control__description,
.wc-block-components-radio-control__secondary-description {
Expand All @@ -54,7 +67,7 @@
margin: em($gap-small) 0;
display: block;
}
.wc-block-components-radio-control__secondary-description {
.wc-block-components-radio-control__description {
color: $gray-700;

> svg {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
.wc-block-components-radio-control__description,
.wc-block-components-radio-control__secondary-description {
@include font-size(small);
line-height: 20px;
line-height: 1.55;
}

// Extra class for specificity.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Always show pickup location address and details and truncate pickup details.

0 comments on commit e7aff94

Please sign in to comment.