Skip to content

Commit

Permalink
move title to one level up in the panel layout
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Nov 24, 2020
1 parent 7dca60c commit 0eb32d3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/Accordion/AccordionEdit.jsx
Expand Up @@ -54,7 +54,7 @@ export default ({
className="input-accordion-title"
transparent
placeholder="Enter Title"
value={column?.blocks_layout?.title}
value={column?.title}
onClick={(e) => e.stopPropagation()}
onChange={(e) => handleTitleChange(e, [colId, column])}
/>
Expand Down
5 changes: 1 addition & 4 deletions src/components/manage/Blocks/Accordion/Edit.jsx
Expand Up @@ -41,10 +41,7 @@ const Edit = (props) => {
const [colId, column] = value;
const modifiedBlock = {
...column,
blocks_layout: {
...column.blocks_layout,
title: e.target.value,
},
title: e.target.value,
};
onChangeBlock(block, {
...data,
Expand Down
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/Accordion/View.jsx
Expand Up @@ -55,7 +55,7 @@ const View = (props) => {
/>
)}
<p {...applyTitleSize(props?.data?.title_size || {})}>
{column?.blocks_layout?.title}
{column?.title}
</p>
</div>
</Accordion.Title>
Expand Down
6 changes: 1 addition & 5 deletions src/components/manage/Blocks/Accordion/util.js
Expand Up @@ -39,11 +39,7 @@ export const AccordionblockHasValue = (content) => {
const blockData = content[blocksFieldname]?.[block];
return blockHasValue(blockData);
});
if (
content[blocksLayoutFieldname].hasOwnProperty('title') &&
content[blocksLayoutFieldname]?.title.length > 0
)
return true;
if (content.hasOwnProperty('title') && content?.title.length > 0) return true;
return blockValue.some((item) => item === true);
};

Expand Down

0 comments on commit 0eb32d3

Please sign in to comment.