@eslam-elmeniawy/react-native-common-components
Version:
Common `ReactNative` components packed in library for usage in projects.
53 lines (50 loc) • 1.52 kB
JavaScript
;
// External imports.
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { Menu } from 'react-native-paper';
// Types imports.
// Internal imports.
import styles from "./TextInput.styles.js";
import SelectInputInput from "./SelectInputInput.js";
import SelectInputMenuItem from "./SelectInputMenuItem.js";
import { getStatusBarHeight } from "../../utils/StatusBarHeight.js";
import { jsx as _jsx } from "react/jsx-runtime";
const SelectInputMenu = /*#__PURE__*/React.memo(props => {
const {
theme,
onItemPressed,
isItemSelected,
isSelectVisible,
dismissSelect,
value,
marginVertical,
marginTop,
marginBottom,
widthHorizontalMarginStyle,
selectProps,
...rest
} = props;
return /*#__PURE__*/_jsx(Menu, {
statusBarHeight: getStatusBarHeight(),
visible: isSelectVisible,
onDismiss: dismissSelect,
anchor: /*#__PURE__*/_jsx(SelectInputInput, {
value: value,
selectProps: selectProps,
...rest
}),
style: StyleSheet.flatten([styles.noVerticalMargin, {
marginTop: marginVertical ?? marginTop,
marginBottom: marginVertical ?? marginBottom
}, widthHorizontalMarginStyle]),
children: selectProps?.items?.map(item => /*#__PURE__*/_jsx(SelectInputMenuItem, {
item: item,
theme: theme,
onItemPressed: onItemPressed,
isItemSelected: isItemSelected
}, item.key))
});
});
export default SelectInputMenu;
//# sourceMappingURL=SelectInputMenu.js.map