diff --git a/src/components/theme/View/TabsChildView.jsx b/src/components/theme/View/TabsChildView.jsx index 63d69fdb..10bce7a0 100644 --- a/src/components/theme/View/TabsChildView.jsx +++ b/src/components/theme/View/TabsChildView.jsx @@ -11,6 +11,7 @@ import { defineMessages, injectIntl } from 'react-intl'; import { map, isMatch } from 'lodash'; import cx from 'classnames'; import SearchBlock from 'volto-addons/SearchBlock/View'; +import { getBasePath } from '~/helpers'; import { Helmet, @@ -20,7 +21,7 @@ import { } from '@plone/volto/helpers'; import { deepSearch } from '~/helpers'; -import { blocks, settings } from '~/config'; +import { blocks, settings } from '../../../config'; const messages = defineMessages({ unknownBlock: { @@ -51,6 +52,8 @@ const DefaultView = props => { activeTab: 0, isMobileSidebarOpen: false, }); + + // TODO: fix this const blocksFieldname = getBlocksFieldname(content); const blocksLayoutFieldname = getBlocksLayoutFieldname(content); @@ -77,16 +80,19 @@ const DefaultView = props => { }); return sidebar; }; - console.log('aici', props.location.pathname); useEffect(() => { - const sidebar = []; - sidebar.push(...getSidebar(navigation.items?.[state.activeTab], 1)); - setState({ - ...state, - sidebar, - }); + if (navigation) { + const sidebar = []; + sidebar.push(...getSidebar(navigation.items?.[state.activeTab], 1)); + setState({ + ...state, + sidebar, + }); + } /* eslint-disable-next-line */ }, [props.navigation, state.activeTab]); + // TODO: fix this + if (!navigation) return ''; return hasBlocksData(content) ? (