From aeed63d44f2fde79576526a849910f67308732da Mon Sep 17 00:00:00 2001 From: David Ichim Date: Fri, 23 Sep 2022 19:56:33 +0300 Subject: [PATCH] change(listing): added text align widget to styling schema --- src/blocks/Listing/schema.js | 17 ++++++++++++++++- src/components/UniversalCard/model.js | 2 -- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/blocks/Listing/schema.js b/src/blocks/Listing/schema.js index 469e3ae7..9e68b37e 100644 --- a/src/blocks/Listing/schema.js +++ b/src/blocks/Listing/schema.js @@ -1,5 +1,15 @@ import { defineMessages } from 'react-intl'; +import alignLeftSVG from '@plone/volto/icons/align-left.svg'; +import alignCenterSVG from '@plone/volto/icons/align-center.svg'; +import clearSVG from '@plone/volto/icons/clear.svg'; + +const ALIGN_VALUE_MAP = [ + ['align_left', alignLeftSVG], + ['align_center', alignCenterSVG], + ['', clearSVG], +]; + const messages = defineMessages({ Type: { id: 'Listing', @@ -54,7 +64,7 @@ export const ListingStylingSchema = ({ intl }) => ({ { id: 'default', title: 'Default', - fields: ['theme', 'rounded', 'inverted'], + fields: ['theme', 'text_align', 'rounded', 'inverted'], }, ], properties: { @@ -68,6 +78,11 @@ export const ListingStylingSchema = ({ intl }) => ({ ['tertiary', intl.formatMessage(messages.ThemeTertiary)], ], }, + text_align: { + title: 'Text align', + widget: 'style_text_align', + actions: ALIGN_VALUE_MAP, + }, inverted: { title: intl.formatMessage(messages.Inverted), description: intl.formatMessage(messages.InvertedHelp), diff --git a/src/components/UniversalCard/model.js b/src/components/UniversalCard/model.js index bf116d25..3a852e0c 100644 --- a/src/components/UniversalCard/model.js +++ b/src/components/UniversalCard/model.js @@ -10,9 +10,7 @@ export class BasicModel { } get(target, name) { - // console.log('get', target, name); if (target.hasOwnProperty(name)) { - // console.log('hasOwn', name); return target[name]; }