Skip to content

Commit

Permalink
add css handle and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasecdb committed Mar 6, 2020
1 parent f0bb3a2 commit bbf5cc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ In order to apply CSS customizations in this and other blocks, follow the instru
| `productPriceContainer` |
| `productPriceCurrency` |
| `productPrice` |
| `productQuantityUnit` |
| `productVariationsContainer` |
| `productVariationsItem` |
| `quantityDropdownContainer` |
Expand Down
6 changes: 5 additions & 1 deletion react/ProductQuantity.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import React from 'react'
import { FormattedMessage } from 'react-intl'
import { useCssHandles } from 'vtex.css-handles'

import { useItemContext } from './components/ItemContext'

const CSS_HANDLES = ['productQuantityUnit'] as const

const ProductQuantity: React.FC = () => {
const { item } = useItemContext()
const cssHandles = useCssHandles(CSS_HANDLES)

return (
<span className="c-muted-1 t-body">
<span className={`${cssHandles.productQuantityUnit} c-muted-1 t-body`}>
<FormattedMessage
id="store/product-list.quantity-units"
values={{ quantity: item.quantity }}
Expand Down

0 comments on commit bbf5cc8

Please sign in to comment.