UNPKG

@wordpress/components

Version:
46 lines (41 loc) 1.16 kB
import { createElement } from "@wordpress/element"; /** * External dependencies */ import { View } from 'react-native'; /** * WordPress dependencies */ import { TextControl } from '@wordpress/components'; import { withPreferredColorScheme } from '@wordpress/compose'; import { useMemo } from '@wordpress/element'; /** * Internal dependencies */ import styles from './actions.scss'; import BottomSeparatorCover from './bottom-separator-cover'; function PanelActions(_ref) { let { actions, getStylesFromColorScheme } = _ref; const mappedActions = useMemo(() => { return actions.map(_ref2 => { let { label, onPress } = _ref2; return createElement(TextControl, { label: label, onPress: onPress, labelStyle: styles.defaultLabelStyle, key: label }); }); }, [actions]); return createElement(View, { style: getStylesFromColorScheme(styles.panelActionsContainer, styles.panelActionsContainerDark) }, mappedActions, createElement(BottomSeparatorCover, null)); } export default withPreferredColorScheme(PanelActions); //# sourceMappingURL=actions.native.js.map