UNPKG

@gechiui/block-editor

Version:
53 lines (50 loc) 1.31 kB
import { createElement } from "@gechiui/element"; /** * External dependencies */ import { useNavigation } from '@react-navigation/native'; /** * GeChiUI dependencies */ import { ColorControl, PanelBody } from '@gechiui/components'; import { useMemo } from '@gechiui/element'; /** * Internal dependencies */ import { blockSettingsScreens } from '../block-settings'; export default function PanelColorGradientSettings(_ref) { let { settings, title } = _ref; const navigation = useNavigation(); const mappedSettings = useMemo(() => { return settings.map(_ref2 => { let { onColorChange, colorValue, onGradientChange, gradientValue, label } = _ref2; return createElement(ColorControl, { onPress: () => { navigation.navigate(blockSettingsScreens.color, { onColorChange, colorValue: gradientValue || colorValue, gradientValue, onGradientChange, label }); }, key: `color-setting-${label}`, label: label, color: gradientValue || colorValue }); }); }, [settings]); return createElement(PanelBody, { title: title }, mappedSettings); } //# sourceMappingURL=panel-color-gradient-settings.native.js.map