@wordpress/components
Version:
UI components for WordPress.
51 lines (42 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _element = require("@wordpress/element");
var _reactNative = require("react-native");
var _components = require("@wordpress/components");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const {
Fill,
Slot
} = (0, _components.createSlotFill)('BottomSheetSubSheet');
const BottomSheetSubSheet = _ref => {
let {
children,
navigationButton,
showSheet,
isFullScreen
} = _ref;
const {
setIsFullScreen
} = (0, _element.useContext)(_components.BottomSheetContext);
(0, _element.useEffect)(() => {
if (showSheet) {
setIsFullScreen(isFullScreen);
} // Disable reason: deferring this refactor to the native team.
// see https://github.com/WordPress/gutenberg/pull/41166
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [showSheet, isFullScreen]);
return (0, _element.createElement)(_element.Fragment, null, showSheet && (0, _element.createElement)(Fill, null, (0, _element.createElement)(_reactNative.SafeAreaView, null, children)), _element.Children.count(children) > 0 && navigationButton);
};
BottomSheetSubSheet.Slot = Slot;
BottomSheetSubSheet.screenName = 'BottomSheetSubSheet';
var _default = BottomSheetSubSheet;
exports.default = _default;
//# sourceMappingURL=index.native.js.map