Skip to content

Commit

Permalink
change(listing): added text align widget to styling schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Sep 23, 2022
1 parent 4a75589 commit aeed63d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 16 additions & 1 deletion src/blocks/Listing/schema.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -54,7 +64,7 @@ export const ListingStylingSchema = ({ intl }) => ({
{
id: 'default',
title: 'Default',
fields: ['theme', 'rounded', 'inverted'],
fields: ['theme', 'text_align', 'rounded', 'inverted'],
},
],
properties: {
Expand All @@ -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),
Expand Down
2 changes: 0 additions & 2 deletions src/components/UniversalCard/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit aeed63d

Please sign in to comment.