@wordpress/components
Version:
UI components for WordPress.
64 lines (60 loc) • 2.11 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _i18n = require("@wordpress/i18n");
var _mediaEdit = require("../media-edit");
var _iconCustomize = _interopRequireDefault(require("./icon-customize"));
var _style = _interopRequireDefault(require("./style.scss"));
var _icon = _interopRequireDefault(require("../../icon"));
var _jsxRuntime = require("react/jsx-runtime");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const accessibilityHint = _reactNative.Platform.OS === 'ios' ? (0, _i18n.__)('Double tap to open Action Sheet to edit, replace, or clear the image') : (0, _i18n.__)('Double tap to open Bottom Sheet to edit, replace, or clear the image');
const ImageEditingButton = ({
onSelectMediaUploadOption,
openMediaOptions,
pickerOptions,
url
}) => {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mediaEdit.MediaEdit, {
onSelect: onSelectMediaUploadOption,
source: {
uri: url
},
openReplaceMediaOptions: openMediaOptions,
render: ({
open,
mediaOptions
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback, {
accessibilityHint: accessibilityHint,
accessibilityLabel: (0, _i18n.__)('Edit image'),
accessibilityRole: "button",
onPress: open,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
style: _style.default.editContainer,
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
style: _style.default.edit,
children: [mediaOptions(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.default, {
size: 16,
icon: _iconCustomize.default,
..._style.default.iconCustomise
})]
})
})
}),
pickerOptions: pickerOptions
});
};
var _default = exports.default = ImageEditingButton;
//# sourceMappingURL=image-editing-button.native.js.map