UNPKG

@fruits-chain/react-native-xiaoshu

Version:
36 lines (34 loc) • 1.13 kB
import React, { memo } from 'react'; import { TouchableOpacity, View } from 'react-native'; import { varCreator as varCreatorButton } from '../button/style'; import Theme from '../theme'; import { varCreator, styleCreator } from './style'; const PopoverItem = _ref => { let { children, value, disabled, dark, style, divider = false, onSelect } = _ref; const TOKENS = Theme.useThemeTokens(); const CV = Theme.createVar(TOKENS, varCreator); const CV_BUTTON = Theme.createVar(TOKENS, varCreatorButton); const STYLES = Theme.createStyle(CV, styleCreator); return /*#__PURE__*/React.createElement(TouchableOpacity, { activeOpacity: CV_BUTTON.button_active_opacity, disabled: disabled, onPress: () => { if (typeof onSelect === 'function') { onSelect(value); } }, style: style }, /*#__PURE__*/React.createElement(View, { style: [STYLES.item_inner, divider ? STYLES.item_inner_divider : null, dark ? STYLES.item_inner_divider_dark : null] }, children)); }; export default /*#__PURE__*/memo(PopoverItem); //# sourceMappingURL=popover-item.js.map