Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
use specific volto alpha version for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiggr committed Oct 4, 2022
1 parent 0979f27 commit 8ab409e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pipeline {
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu"
DEPENDENCIES = ""
VOLTO = "alpha"
VOLTO = "16.0.0-alpha.14"
}

stages {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import cx from 'classnames';
import { buildStyleClassNamesFromData } from '@plone/volto/helpers';

const StyleWrapper = (props) => {
const { children, data = {} } = props;
const styles = buildStyleClassNamesFromData(data.styles);
const rewrittenChildren = React.Children.map(children, (child) => {
if (React.isValidElement(child)) {
const childProps = {
...props,
className: cx([child.props.className, ...styles]),
};
return React.cloneElement(child, childProps);
}
return child;
});

return rewrittenChildren;
};

export default StyleWrapper;

0 comments on commit 8ab409e

Please sign in to comment.