Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add labelListPrice prop in ProductSummaryPrice #156

Merged
merged 4 commits into from
May 21, 2019
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.21.0] - 2019-05-21
### Fixed
- Include `labelListPrice` prop in `productSummaryPrice`.

## [2.20.3] - 2019-05-14
### Fixed
- ProductQuantityStepper was sending undefined seller param to updateItems mutation.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Through the Storefront, you can change the product-summary's behavior and interf
| `showBadge` | `Boolean` | Set the discount badge's visibility |
| `showDescription` | `Boolean` | Set product's description visibility |
| `labelSellingPrice` | `String` | Text of selling price's label |
| `labelListPrice` | `String` | Text of list price's label |
| `badgeText` | `String` | Text shown on badge |
| `buyButtonText` | `String` | Custom buy button text |
| `displayBuyButton` | `Enum` | Set display mode of buy button (displayButtonAlways, displayButtonHover, displayButtonNone) |
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"vendor": "vtex",
"name": "product-summary",
"version": "2.20.3",
"version": "2.21.0",
"title": "Product Summary",
"description": "Product summary component",
"defaultLocale": "pt-BR",
Expand Down
10 changes: 10 additions & 0 deletions react/components/ProductSummaryPrice/ProductSummaryPrice.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ProductSummaryPrice = ({
showLabels,
showInstallments,
labelSellingPrice,
labelListPrice,
showBorders,
}) => {
const { product, isLoading } = useContext(ProductSummaryContext)
Expand Down Expand Up @@ -58,6 +59,7 @@ const ProductSummaryPrice = ({
showLabels={showLabels}
showInstallments={showInstallments}
labelSellingPrice={labelSellingPrice}
labelListPrice={labelListPrice}
/>
)}
</div>
Expand All @@ -73,6 +75,8 @@ ProductSummaryPrice.propTypes = {
showInstallments: PropTypes.bool,
/** Text of selling Price's label */
labelSellingPrice: PropTypes.string,
/** Text of list Price's label */
labelListPrice: PropTypes.string,
/** Set installments' visibility */
showBorders: PropTypes.bool,
}
Expand All @@ -82,6 +86,7 @@ ProductSummaryPrice.defaultProps = {
showInstallments: true,
showLabels: true,
labelSellingPrice: '',
labelListPrice: '',
showBorders: false,
}

Expand Down Expand Up @@ -114,6 +119,11 @@ ProductSummaryPrice.getSchema = () => {
title: 'admin/editor.productSummary.labelSellingPrice.title',
isLayout: false,
},
labelListPrice: {
type: 'string',
title: 'admin/editor.productSummary.labelListPrice.title',
isLayout: false,
},
showBorders: {
type: 'boolean',
title: 'admin/editor.productSummary.showBorders.title',
Expand Down
1 change: 1 addition & 0 deletions react/components/ProductSummaryPrice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Through the Storefront, you can change the `ProductSummaryPrice`'s behavior and
| `showInstallments` | `Boolean` | Set installments' visibility | `true` |
| `showLabels` | `Boolean` | Set pricing labels' visibility | `true` |
| `labelSellingPrice` | `String` | Text of selling price's label | |
| `labelListPrice` | `String` | Text of list price's label | |
| `showBorders` | `Boolean` | Set product's borders visibility | `false` |

### Styles API
Expand Down
4 changes: 4 additions & 0 deletions react/legacy/components/ProductSummaryPrice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ProductSummaryPrice = ({
showLabels,
showInstallments,
labelSellingPrice,
labelListPrice,
isLoading,
containerClass,
}) => {
Expand Down Expand Up @@ -49,6 +50,7 @@ const ProductSummaryPrice = ({
showLabels={showLabels}
showInstallments={showInstallments}
labelSellingPrice={labelSellingPrice}
labelListPrice={labelListPrice}
/>
)}
</div>
Expand All @@ -66,6 +68,8 @@ ProductSummaryPrice.propTypes = {
showInstallments: PropTypes.bool,
/** Text of selling Price's label */
labelSellingPrice: PropTypes.string,
/** Text of selling Price's label */
labelListPrice: PropTypes.string,
/** Defines if the loading spinner is shown */
isLoading: PropTypes.bool,
/** Styles used in the container div */
Expand Down
4 changes: 4 additions & 0 deletions react/legacy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class ProductSummary extends Component {
showQuantitySelector: PropTypes.bool,
/** Text of selling Price's label */
labelSellingPrice: PropTypes.string,
/** Text of list Price's label */
labelListPrice: PropTypes.string,
/** Text shown on badge */
badgeText: PropTypes.string,
/** Custom buy button text */
Expand Down Expand Up @@ -128,6 +130,7 @@ class ProductSummary extends Component {
showLabels,
showInstallments,
labelSellingPrice,
labelListPrice,
name: showFieldsProps,
showQuantitySelector,
priceAlignLeft,
Expand All @@ -148,6 +151,7 @@ class ProductSummary extends Component {
showLabels,
showInstallments,
labelSellingPrice,
labelListPrice,
isLoading: this.state.isUpdatingItems,
}

Expand Down