Skip to content

Commit f39fb69

Browse files
iFlameingdanalvrz
andauthored
Fix advanced facet toggle not working in Search block. (#882)
Co-authored-by: Dante Álvarez <89805481+danalvrz@users.noreply.github.com>
1 parent 1c71a18 commit f39fb69

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix advanced facet toggle not working in Search block. @iFlameing

frontend/packages/volto-light-theme/src/components/Blocks/Search/TopSideFacets.jsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,24 @@ const TopSideFacets = (props) => {
4545
const isLive = !showSearchButton;
4646
const intl = useIntl();
4747

48-
const FacetWrapper = ({ children }) => {
48+
const FacetWrapper = ({ children, facetSettings = {}, visible }) => {
49+
const { advanced, field = {} } = facetSettings;
4950
const colWidth = data.facets.length < 5 ? 12 / data.facets.length : 4;
51+
const className = [
52+
'facet',
53+
field.value ? `facet-index-${field.value}` : '',
54+
advanced ? 'advanced-facet' : '',
55+
!visible ? 'advanced-facet-hidden' : '',
56+
]
57+
.filter(Boolean)
58+
.join(' ');
5059
return (
51-
<Grid.Column mobile={12} tablet={colWidth} computer={colWidth}>
60+
<Grid.Column
61+
mobile={12}
62+
tablet={colWidth}
63+
computer={colWidth}
64+
className={className}
65+
>
5266
{children}
5367
</Grid.Column>
5468
);

frontend/packages/volto-light-theme/src/theme/_bgcolor-blocks-layout.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,21 @@
796796
color: var(--theme-low-contrast-foreground-color);
797797
}
798798

799+
.toggle-advanced-facets button {
800+
border: 1px solid var(--theme-foreground-color);
801+
border-color: var(--theme-foreground-color);
802+
border-radius: unset;
803+
background-color: var(--theme-color);
804+
805+
color: var(--theme-foreground-color);
806+
807+
&:hover {
808+
border-color: var(--theme-foreground-color);
809+
background-color: var(--theme-foreground-color);
810+
color: var(--theme-color);
811+
}
812+
}
813+
799814
.react-select-container {
800815
.react-select__menu {
801816
background-color: var(--theme-high-contrast-color);

0 commit comments

Comments
 (0)