Skip to content

Commit

Permalink
Adjusting attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
julixC committed Feb 25, 2025
1 parent 62ed550 commit 4ab8c7e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions react/components/FacetItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import classNames from 'classnames'
import { useSearchPage } from 'vtex.search-page-context/SearchPageContext'
import { usePixel } from 'vtex.pixel-manager'
import { useIntl } from 'react-intl'

Check failure on line 7 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

There should be at least one empty line between import groups

import { pushFilterManipulationPixelEvent } from '../utils/filterManipulationPixelEvents'
import SettingsContext from './SettingsContext'
import ShippingActionButton from './ShippingActionButton'
import useShippingActions from '../hooks/useShippingActions'

Check failure on line 11 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

There should be at least one empty line between import groups
import { useRuntime } from 'vtex.render-runtime'

Check failure on line 12 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

`vtex.render-runtime` import should occur before import of `../utils/filterManipulationPixelEvents`

const CSS_HANDLES = ['filterItem', 'productCount', 'filterItemTitle']

Expand Down Expand Up @@ -107,7 +107,7 @@ const FacetItem = ({
</>
)
}

Check failure on line 110 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

Delete `····`
return labelElement
}, [
showFacetQuantity,
Expand All @@ -125,6 +125,16 @@ const FacetItem = ({
intl,
])

const { query: runtimeQuery } = useRuntime()

let initialquery = undefined;

Check failure on line 130 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

It's not necessary to initialize 'initialquery' to undefined

Check failure on line 130 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

Delete `;`
let initialmap = undefined;

Check failure on line 131 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

It's not necessary to initialize 'initialmap' to undefined

Check failure on line 131 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

Delete `;`

if(searchQuery?.variables?.fullText === undefined){

Check failure on line 133 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

Replace `(searchQuery?.variables?.fullText·===·undefined)` with `·(searchQuery?.variables?.fullText·===·undefined)·`
initialquery = runtimeQuery?.initialQuery ?? searchQuery?.facets?.queryArgs.query;

Check failure on line 134 in react/components/FacetItem.js

View workflow job for this annotation

GitHub Actions / Lint

Replace `·runtimeQuery?.initialQuery·??·searchQuery?.facets?.queryArgs.query;` with `⏎······runtimeQuery?.initialQuery·??·searchQuery?.facets?.queryArgs.query`
initialmap = runtimeQuery?.initialMap ?? searchQuery?.facets?.queryArgs?.map;
}

return (
<div
className={classes}
Expand Down Expand Up @@ -152,7 +162,9 @@ const FacetItem = ({
value={facet.value}
facetKey={facet.key}
isClicked={selected.toString()}
queryText={searchQuery?.variables?.query}
fullText={searchQuery?.variables?.fullText}
initialMap={initialmap}
initialQuery={initialquery}
/>
</div>
)
Expand Down

0 comments on commit 4ab8c7e

Please sign in to comment.