@wordpress/block-library
Version:
Block library for the WordPress editor.
46 lines (41 loc) • 952 B
JavaScript
import { createElement } from "@wordpress/element";
/**
* External dependencies
*/
import { View } from 'react-native';
/**
* WordPress dependencies
*/
import { Gradient, colorsUtils } from '@wordpress/components';
/**
* Internal dependencies
*/
import styles from './editor.scss';
function ColorBackground(_ref) {
let {
children,
borderRadiusValue,
backgroundColor
} = _ref;
const {
isGradient
} = colorsUtils;
const wrapperStyles = [styles.richTextWrapper, {
borderRadius: borderRadiusValue,
backgroundColor
}];
return createElement(View, {
style: wrapperStyles
}, isGradient(backgroundColor) && createElement(Gradient, {
gradientValue: backgroundColor,
angleCenter: {
x: 0.5,
y: 0.5
},
style: [styles.linearGradient, {
borderRadius: borderRadiusValue
}]
}), children);
}
export default ColorBackground;
//# sourceMappingURL=color-background.native.js.map