@wordpress/components
Version:
UI components for WordPress.
50 lines (48 loc) • 1.82 kB
JavaScript
/**
* External dependencies
*/
import { useRoute, useNavigation } from '@react-navigation/native';
/**
* WordPress dependencies
*/
import { useContext, useMemo } from '@wordpress/element';
/**
* Internal dependencies
*/
import { ColorPicker } from '../../color-picker';
import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';
import { jsx as _jsx } from "react/jsx-runtime";
const PickerScreen = () => {
const route = useRoute();
const navigation = useNavigation();
const {
onShouldEnableInnerHandling,
shouldEnableBottomSheetMaxHeight,
onHandleClosingBottomSheet,
isBottomSheetContentScrolling,
shouldEnableBottomSheetScroll,
onHandleHardwareButtonPress
} = useContext(BottomSheetContext);
const {
setColor,
currentValue,
isGradientColor
} = route.params;
return useMemo(() => {
return /*#__PURE__*/_jsx(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]);
};
export default PickerScreen;
//# sourceMappingURL=picker-screen.native.js.map