Skip to content

Commit

Permalink
Checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Dec 29, 2022
1 parent af3337b commit e7b0e90
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/SearchBlock/BlockContainer/BlockContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Button } from 'semantic-ui-react';
import { useLocation } from 'react-router-dom';
import { Icon, RenderBlocks } from '@plone/volto/components';
import config from '@plone/volto/registry';

import clearSVG from '@plone/volto/icons/clear.svg';

Expand Down Expand Up @@ -31,6 +32,20 @@ export default function BlockContainer(props) {
};
const metadata = {};
const index = 0;

const blocksConfig = React.useMemo(
() =>
Object.assign(
{},
...Object.entries(config.blocks.blocksConfig).map(
([blockId, blockConfig]) => ({
[blockId]: { ...blockConfig, blockHasOwnFocusManagement: true },
}),
),
),
[],
);

return mode === 'view' ? (
<RenderBlocks content={content} metadata={metadata} location={location} />
) : (
Expand Down Expand Up @@ -60,6 +75,7 @@ export default function BlockContainer(props) {
onSelectBlock={(id, isSelected) => onSelectSlotfill(id)}
index={index}
disableNewBlocks={true}
blocksConfig={blocksConfig}
/>
</>
) : (
Expand Down
8 changes: 7 additions & 1 deletion src/SearchBlock/templates/FullView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ function FullView(props) {
<BodyClass className={`${appName}-view searchlib-page`}>
<div className="searchlib-block">
{mode !== 'view' && (
<div className="overlay" style={overlayStyle}></div>
<div
role="presentation"
onKeyDown={() => onSelectSlotfill(null)}
className="overlay"
style={overlayStyle}
onClick={() => onSelectSlotfill(null)}
></div>
)}
<SearchApp
{...props}
Expand Down

0 comments on commit e7b0e90

Please sign in to comment.