UNPKG

expo-datepicker

Version:
20 lines (19 loc) 1.12 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = __importDefault(require("react")); const react_native_1 = require("react-native"); ; function Item(props) { const { onPress, value, current, option, selectedColor, selectedTextColor, itemStyleModal, textStyleModal } = props; const isSelected = Number(value) === Number(current === null || current === void 0 ? void 0 : current.value); return (<react_native_1.TouchableOpacity onPress={() => onPress(option)} style={Object.assign({ backgroundColor: isSelected ? selectedColor : 'rgba(0,0,0,0.0)', width: '100%', height: 40, justifyContent: 'center', alignItems: 'center' }, itemStyleModal)}> <react_native_1.Text style={Object.assign({ color: isSelected ? selectedTextColor : 'black', fontSize: 16 }, textStyleModal)}> {option.label} </react_native_1.Text> </react_native_1.TouchableOpacity>); } exports.default = Item; //# sourceMappingURL=item.js.map