Skip to content

Commit

Permalink
Pass location to renderblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim authored and wesleybl committed Dec 20, 2022
1 parent e8c0e8b commit 0c7d9ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ColumnsBlock/ColumnsBlockView.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { useLocation } from 'react-router-dom';
import config from '@plone/volto/registry';
import { Grid } from 'semantic-ui-react';
import { RenderBlocks } from '@plone/volto/components';
Expand All @@ -20,6 +21,7 @@ const getSides = (v) => {
};

const ColumnsBlockView = (props) => {
const location = useLocation();
const { gridSizes } = config.blocks.blocksConfig[COLUMNSBLOCK];
const { data = {}, gridSize = 12, gridCols = [] } = props.data;
const metadata = props.metadata || props.properties;
Expand Down Expand Up @@ -58,7 +60,12 @@ const ColumnsBlockView = (props) => {
: {}
}
>
<RenderBlocks {...props} metadata={metadata} content={column} />
<RenderBlocks
{...props}
location={location}
metadata={metadata}
content={column}
/>
</div>
</Grid.Column>
);
Expand Down

0 comments on commit 0c7d9ad

Please sign in to comment.