Skip to content

Commit

Permalink
decorate, stlying edit,View
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Nov 23, 2020
1 parent ba33d9a commit dc521e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/Accordion/AccordionEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default ({
>
<div
className={cx('align-arrow-left', {
'align-arrow-right': data.arrow_select,
'align-arrow-right': data?.data?.blocks?.settings?.arrow_select,
})}
>
{activeIndex === 0 ? (
Expand Down
6 changes: 1 addition & 5 deletions src/components/manage/Blocks/Accordion/Schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const accordionBlockSchema = () => ({
{
id: 'default',
title: 'Default',
fields: ['data', 'arrow_select'], // 'nrColumns', 'block_title'
fields: ['data'], // 'nrColumns', 'block_title'
},
],
properties: {
Expand All @@ -111,10 +111,6 @@ export const accordionBlockSchema = () => ({
type: 'panels',
schema: AccordionSchema,
},
arrow_select: {
title: 'Align arrow to right',
type: 'boolean',
},
},
required: ['title'],
});
Expand Down
11 changes: 8 additions & 3 deletions src/components/manage/Blocks/Accordion/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import React from 'react';
import { RenderBlocks } from '@eeacms/volto-blocks-form/components';
import { getColumns, GroupblockHasValue } from './util';
import { Accordion } from 'semantic-ui-react';
import { applyBgColor } from '@eeacms/volto-accordion-block/components/manage/Styles';
import {
applyBgColor,
applyTitleSize,
} from '@eeacms/volto-accordion-block/components/manage/Styles';

import cx from 'classnames';
import { Icon } from '@plone/volto/components';
Expand Down Expand Up @@ -39,15 +42,17 @@ const View = (props) => {
>
<div
className={cx('align-arrow-left', {
'align-arrow-right': props.data.arrow_select,
'align-arrow-right': data?.blocks?.settings?.arrow_select,
})}
>
{activeIndex === index ? (
<Icon name={downSVG} size="20px" />
) : (
<Icon name={rightSVG} size="20px" />
)}
<p>{column?.blocks?.acc_title}</p>
<p {...applyTitleSize(data?.blocks?.settings || {})}>
{column?.blocks?.acc_title}
</p>
</div>
</Accordion.Title>
<div>
Expand Down
29 changes: 6 additions & 23 deletions src/components/manage/Styles/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const StyleSchema = () => ({
{
id: 'default',
title: 'Style',
fields: ['backgroundColor', 'title_size'],
fields: ['backgroundColor', 'title_size', 'arrow_select'],
},
],
properties: {
Expand All @@ -27,28 +27,11 @@ export const StyleSchema = () => ({
['xxx-large', 'xxx-large'],
],
},
},
required: [],
});

export const TextSettingsSchema = {
title: 'Text settings',
fieldsets: [
{
id: 'text_settings',
title: 'Text settings',
fields: ['grid_column_align_text', 'grid_column_text_color'],
},
],
properties: {
grid_column_align_text: {
title: 'Text align',
widget: 'align',
},
grid_column_text_color: {
title: 'Text color',
widget: 'color_picker',
arrow_select: {
title: 'Toggle arrows',
type: 'boolean',
default: false,
},
},
required: [],
};
});

0 comments on commit dc521e5

Please sign in to comment.