Skip to content

Commit

Permalink
add sponsoredCount-prop
Browse files Browse the repository at this point in the history
  • Loading branch information
hiagolcm committed Nov 29, 2024
1 parent 5eb8fe7 commit 99ff7a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Removed
- `sponsoredProductsBehavior` prop which is deprecated

### Added
- `sponsoredCount` prop

## [2.137.3] - 2024-10-08

### Changed
Expand Down
13 changes: 4 additions & 9 deletions react/SearchContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const SearchContext = ({
installmentCriteria,
excludedPaymentSystems,
includedPaymentSystems,
sponsoredProductsBehavior = 'sync',
query: {
order: orderBy = orderByField || SORT_OPTIONS[0].value,
page: pageQuery,
Expand All @@ -39,6 +38,7 @@ const SearchContext = ({
searchState,
},
children,
sponsoredCount,
__unstableProductOriginVtex,
}) => {
const {
Expand Down Expand Up @@ -120,8 +120,8 @@ const SearchContext = ({
operator={operator}
fuzzy={fuzzy}
searchState={state}
sponsoredCount={sponsoredCount}
__unstableProductOriginVtex={__unstableProductOriginVtex}
sponsoredProductsBehavior={sponsoredProductsBehavior}
>
{(searchQuery, extraParams) => {
return React.cloneElement(children, {
Expand Down Expand Up @@ -200,8 +200,8 @@ SearchContext.propTypes = {
installmentCriteria: PropTypes.string,
excludedPaymentSystems: PropTypes.string,
includedPaymentSystems: PropTypes.string,
sponsoredCount: PropTypes.number,
__unstableProductOriginVtex: PropTypes.bool,
sponsoredProductsBehavior: PropTypes.string,
}

SearchContext.schema = {
Expand Down Expand Up @@ -231,12 +231,7 @@ SearchContext.schema = {
title: 'admin/editor.product-search.hideUnavailableItems',
type: 'boolean',
default: false,
},
sponsoredProductsBehavior: {
title: 'Sponsored products behavior',
type: 'string',
default: 'sync',
},
}

Check failure on line 234 in react/SearchContext.jsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `,`
},
}

Expand Down

0 comments on commit 99ff7a7

Please sign in to comment.