@wordpress/components
Version:
UI components for WordPress.
57 lines (53 loc) • 2.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _native = require("@react-navigation/native");
var _element = require("@wordpress/element");
var _colorPicker = require("../../color-picker");
var _bottomSheetContext = require("../bottom-sheet/bottom-sheet-context");
var _jsxRuntime = require("react/jsx-runtime");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const PickerScreen = () => {
const route = (0, _native.useRoute)();
const navigation = (0, _native.useNavigation)();
const {
onShouldEnableInnerHandling,
shouldEnableBottomSheetMaxHeight,
onHandleClosingBottomSheet,
isBottomSheetContentScrolling,
shouldEnableBottomSheetScroll,
onHandleHardwareButtonPress
} = (0, _element.useContext)(_bottomSheetContext.BottomSheetContext);
const {
setColor,
currentValue,
isGradientColor
} = route.params;
return (0, _element.useMemo)(() => {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_colorPicker.ColorPicker, {
onShouldEnableInnerHandling: onShouldEnableInnerHandling,
shouldEnableBottomSheetMaxHeight: shouldEnableBottomSheetMaxHeight,
setColor: setColor,
activeColor: currentValue,
isGradientColor: isGradientColor,
onNavigationBack: navigation.goBack,
onHandleClosingBottomSheet: onHandleClosingBottomSheet,
isBottomSheetContentScrolling: isBottomSheetContentScrolling,
shouldEnableBottomSheetScroll: shouldEnableBottomSheetScroll,
onHandleHardwareButtonPress: onHandleHardwareButtonPress
});
// See https://github.com/WordPress/gutenberg/pull/41166
}, [setColor, currentValue, isGradientColor, onShouldEnableInnerHandling, shouldEnableBottomSheetMaxHeight, onHandleClosingBottomSheet, isBottomSheetContentScrolling, shouldEnableBottomSheetScroll, onHandleHardwareButtonPress]);
};
var _default = exports.default = PickerScreen;
//# sourceMappingURL=picker-screen.native.js.map