@eslam-elmeniawy/react-native-common-components
Version:
Common `ReactNative` components packed in library for usage in projects.
43 lines (40 loc) • 1.03 kB
JavaScript
;
// External imports.
import * as React from 'react';
// Types imports.
// Internal imports.
import styles from "./SelectDialog.styles.js";
import { FlatList } from "../FlatList/index.js";
import { Checkbox } from "../CompoundButton/index.js";
import { jsx as _jsx } from "react/jsx-runtime";
const List = /*#__PURE__*/React.memo(props => {
const {
items,
theme,
onItemPressed,
isItemSelected
} = props;
const _getListItem = item => /*#__PURE__*/_jsx(Checkbox, {
style: styles.selectItem,
onPress: () => onItemPressed(item),
checked: isItemSelected(item),
checkedColor: theme.colors.primary,
uncheckedColor: theme.colors.onSurface,
text: item.dropdownTitle,
textProps: {
style: {
color: theme.colors.onSurface
}
}
});
return /*#__PURE__*/_jsx(FlatList, {
data: items,
renderItem: ({
item
}) => _getListItem(item),
bounces: false,
style: styles.list
});
});
export default List;
//# sourceMappingURL=List.js.map