Skip to content

Commit

Permalink
Add theme picker widget
Browse files Browse the repository at this point in the history
  • Loading branch information
dana-cfc4 committed Jan 31, 2023
1 parent dd14109 commit b567515
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -17,6 +17,9 @@
"type": "git",
"url": "git@github.com:eea/volto-accordion-block.git"
},
"dependencies": {
"@eeacms/volto-widget-theme-picker": "1.0.0"
},
"devDependencies": {
"@cypress/code-coverage": "^3.10.0",
"@plone/scripts": "*",
Expand Down
13 changes: 9 additions & 4 deletions src/components/manage/Blocks/Accordion/Schema.js
@@ -1,3 +1,4 @@
import config from '@plone/volto/registry';
import { defineMessages } from 'react-intl';
import { addStyling } from '@plone/volto/helpers';

Expand Down Expand Up @@ -162,10 +163,14 @@ export const AccordionStylingSchema = (props) => {
theme: {
title: intl.formatMessage(messages.Theme),
description: intl.formatMessage(messages.ThemeHelp),
choices: [
['primary', intl.formatMessage(messages.ThemePrimary)],
['secondary', intl.formatMessage(messages.ThemeSecondary)],
['tertiary', intl.formatMessage(messages.ThemeTertiary)],
widget: 'theme_picker',
colors: [
...(config.settings && config.settings.themeColors
? config.settings.themeColors.map(({ value, title }) => ({
name: value,
label: title,
}))
: []),
],
},
},
Expand Down

0 comments on commit b567515

Please sign in to comment.