Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listing bg color #475

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/config/italiaConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ import { schemaListing } from 'design-comuni-plone-theme/components/ItaliaTheme/

import reducers from 'design-comuni-plone-theme/reducers';

const ReleaseLog = loadable(
() => import('design-comuni-plone-theme/components/ReleaseLog/ReleaseLog'),
const ReleaseLog = loadable(() =>
import('design-comuni-plone-theme/components/ReleaseLog/ReleaseLog'),
);

const messages = defineMessages({
Expand Down Expand Up @@ -486,10 +486,9 @@ export default function applyConfig(voltoConfig) {
},
};
// Remove Horizontal Menu variation of TOC Block
config.blocks.blocksConfig.toc.variations =
config.blocks.blocksConfig.toc.variations.filter(
(v) => v.id !== 'horizontalMenu',
);
config.blocks.blocksConfig.toc.variations = config.blocks.blocksConfig.toc.variations.filter(
(v) => v.id !== 'horizontalMenu',
);

// COMPONENTS
config.components = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@ const ListingBody = React.memo(

if (!block?.show_block_bg && !isSearchBlockResults) return 'full-width';

let bg_color = data.bg_color ? `bg-${data.bg_color}` : '';
let bg_color = config.blocks?.blocksConfig[
'listing'
]?.listing_bg_colors.some((color) => color.name === data.bg_color)
? `bg-${data.bg_color}`
: 'bg-light';

if (block.template === 'gridGalleryTemplate') {
return `section section-muted section-inset-shadow py-5 ${bg_color} ${
isSearchBlockResults ? '' : 'full-width'
}`;
} else {
return `py-5 ${bg_color} ${
isSearchBlockResults ? 'template-wrapper' : 'bg-light full-width'
isSearchBlockResults ? 'template-wrapper' : 'full-width'
}`;
}
};
Expand Down