Skip to content

Commit

Permalink
Feat added unavailable class name (#1101)
Browse files Browse the repository at this point in the history
#### What problem is this solving?

PDP Sku selector shows unavailable items crossed out. Some clients
require to hide these items via CSS with a CSS HANDLE

#### How to test it?

Go to the workspace and use css to hide class unavailable


[Workspace](https://jorge--esikaperu.myvtex.com/labial-liquido-hidracolor-mate/p?skuId=200103718)

#### Screenshots or example usage:


![image](https://github.com/vtex-apps/store-components/assets/94565086/56ec8d85-ee45-4855-b66d-259f834090ad)


![image](https://github.com/vtex-apps/store-components/assets/94565086/12c07b5e-af76-4468-b537-fcc16396afb1)


#### Describe alternatives you've considered, if any.

<!--- Optional -->

#### Related to / Depends on

<!--- Optional -->

#### How does this PR make you feel? [:link:](http://giphy.com/)

<!-- Go to http://giphy.com/ and pick a gif that represents how this PR
makes you feel -->

![](put .gif link here - can be found under "advanced" on giphy)

---------

Co-authored-by: Jorge Acosta <jorge.acosta@vtex.com>
  • Loading branch information
jorgeAcostaVTEX and Jorge Acosta authored Feb 9, 2024
1 parent 5f27586 commit 7db1881
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- CSS Handle for unavailable products update.


## [3.171.0] - 2024-01-09

## [3.170.0] - 2023-11-28
Expand Down
7 changes: 6 additions & 1 deletion react/components/SKUSelector/components/SelectorItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const CSS_HANDLES = [
'frameAround',
'valueWrapper',
'diagonalCross',
'unavailable',
'skuSelectorItem',
'skuSelectorBadge',
'skuSelectorItemImage',
Expand Down Expand Up @@ -81,15 +82,19 @@ function SelectorItem({
{
[`${handles.skuSelectorItemImage}`]: isImage,
'o-20': isImpossible,
}
},
'valueWrapper',
!isAvailable ? `${handles.unavailable}` : ''
),
[
isImage,
isAvailable,
isSelected,
isImpossible,
variationValueOriginalName,
withModifiers,
handles.skuSelectorItemImage,
handles.unavailable,
]
)

Expand Down

0 comments on commit 7db1881

Please sign in to comment.