Skip to content

Commit

Permalink
remove debugging code & make color picker check for themes in config
Browse files Browse the repository at this point in the history
  • Loading branch information
danalvrz committed Nov 14, 2024
1 parent 13b2b14 commit 2879abe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { Button } from '@plone/components';
import cx from 'classnames';
import config from '@plone/volto/registry';

type Color =
| {
Expand Down Expand Up @@ -29,7 +30,7 @@ export type ColorPickerWidgetProps = {

const ColorPickerWidget = (props: ColorPickerWidgetProps) => {
const { id, value, onChange } = props;
const colors = props.themes || props.colors || [];
const colors = config.blocks.themes || props.themes || props.colors || [];

return colors.length > 0 ? (
<FormFieldWrapper {...props} className="theme-picker-widget">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
getBlocksFieldname,
blockHasValue,
buildStyleClassNamesFromData,
findStyleByName,
buildStyleClassNamesExtenders,
} from '@plone/volto/helpers/Blocks/Blocks';
import dragSVG from '@plone/volto/icons/drag.svg';
Expand Down Expand Up @@ -80,12 +81,11 @@ const EditBlockWrapper = (props) => {
classNames,
});

// // START CUSTOMIZATION
// const style = data.theme
// ? findStyleByName(config.blocks.themes, data.theme)
// : findStyleByName(config.blocks.themes, config.blocks.themes[0].name);
// // END CUSTOMIZATION
const style = {};
// START CUSTOMIZATION
const style = data.theme
? findStyleByName(config.blocks.themes, data.theme)
: findStyleByName(config.blocks.themes, config.blocks.themes[0].name);
// END CUSTOMIZATION

// We need to merge the StyleWrapper styles with the draggable props from b-D&D
const styleMergedWithDragProps = {
Expand Down

0 comments on commit 2879abe

Please sign in to comment.