@gechiui/components
Version:
UI components for GeChiUI.
39 lines (35 loc) • 1.04 kB
JavaScript
import { createElement, Fragment } from "@gechiui/element";
/**
* External dependencies
*/
import { SafeAreaView } from 'react-native';
/**
* GeChiUI dependencies
*/
import { Children, useEffect, useContext } from '@gechiui/element';
import { createSlotFill, BottomSheetContext } from '@gechiui/components';
const {
Fill,
Slot
} = createSlotFill('BottomSheetSubSheet');
const BottomSheetSubSheet = _ref => {
let {
children,
navigationButton,
showSheet,
isFullScreen
} = _ref;
const {
setIsFullScreen
} = useContext(BottomSheetContext);
useEffect(() => {
if (showSheet) {
setIsFullScreen(isFullScreen);
}
}, [showSheet, isFullScreen]);
return createElement(Fragment, null, showSheet && createElement(Fill, null, createElement(SafeAreaView, null, children)), Children.count(children) > 0 && navigationButton);
};
BottomSheetSubSheet.Slot = Slot;
BottomSheetSubSheet.screenName = 'BottomSheetSubSheet';
export default BottomSheetSubSheet;
//# sourceMappingURL=index.native.js.map