UNPKG

@wordpress/components

Version:
60 lines (55 loc) 1.7 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@wordpress/element"; /** * External dependencies */ import { TouchableWithoutFeedback, View, Platform } from 'react-native'; /** * WordPress dependencies */ import { Icon } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import { MediaEdit } from '../media-edit'; import SvgIconCustomize from './icon-customize'; import styles from './style.scss'; const accessibilityHint = Platform.OS === 'ios' ? __('Double tap to open Action Sheet to edit, replace, or clear the image') : __('Double tap to open Bottom Sheet to edit, replace, or clear the image'); const ImageEditingButton = _ref => { let { onSelectMediaUploadOption, openMediaOptions, pickerOptions, url } = _ref; return createElement(MediaEdit, { onSelect: onSelectMediaUploadOption, source: { uri: url }, openReplaceMediaOptions: openMediaOptions, render: _ref2 => { let { open, mediaOptions } = _ref2; return createElement(TouchableWithoutFeedback, { accessibilityHint: accessibilityHint, accessibilityLabel: __('Edit image'), accessibilityRole: 'button', onPress: open }, createElement(View, { style: styles.editContainer }, createElement(View, { style: styles.edit }, mediaOptions(), createElement(Icon, _extends({ size: 16, icon: SvgIconCustomize }, styles.iconCustomise))))); }, pickerOptions: pickerOptions }); }; export default ImageEditingButton; //# sourceMappingURL=image-editing-button.native.js.map