Skip to content

Commit

Permalink
fix(ui): add hardcoded folder behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
RaneHyv committed Mar 11, 2024
1 parent 450aa7e commit c7f9792
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions frontend/src/customizations/components/theme/View/DefaultView.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import React from 'react';

import { RenderBlocks } from '@plone/volto/components';
import { getBaseUrl, hasBlocksData } from '@plone/volto/helpers';
import { Container } from 'semantic-ui-react';

import { hasBlocksData, getBaseUrl } from '@plone/volto/helpers';

// Customized to hide the title and description blocks, as they are included in
// the header

Expand All @@ -26,20 +23,29 @@ const DefaultView = (props) => {
const { content, location } = props;
const path = getBaseUrl(location?.pathname || '');

const eventListPage =
path === '/nl/ontdek-het-paleis/zien-doen/tentoonstellingen' ||
path === '/nl/ontdek-het-paleis/zien-doen/tentoonstellingen/' ||
path === '/nl/ontdek-het-paleis/zien-doen/activiteiten' ||
path === '/nl/ontdek-het-paleis/zien-doen/activiteiten/';

// const description = content?.description;
const hasLeadImage = content?.preview_image;
const filteredContent = hasLeadImage
? filterBlocks(content, ['title', 'description'])
: content;

return hasBlocksData(content) ? (
<div id="page-document" className="ui container">
<div
id={eventListPage ? 'page-folder' : 'page-document'}
className="ui container"
>
<div className="content-container">
<RenderBlocks {...props} path={path} content={filteredContent} />
</div>
</div>
) : (
<Container id="page-document">
<Container id={eventListPage ? 'page-folder' : 'page-document'}>
<div className="content-container">
{/* default title+description blocks are inserted by the HeroSection */}
{content.remoteUrl && (
Expand Down

0 comments on commit c7f9792

Please sign in to comment.