UNPKG

react-native-nepali-picker

Version:

Minimalist and modern Nepali-date picker with customization.🌟

57 lines (56 loc) • 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _reactNative = require("react-native"); var _config = require("./calendar/config.js"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } const DayCell = /*#__PURE__*/_react.default.memo(({ day, isSelectedDay, onPress, dark, brandColor, language, dayTextStyle, disabled }) => { if (!day) { return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: { width: '14.28%', paddingVertical: 10 } }); } return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, { onPress: () => !disabled && onPress(day), style: [{ width: '14.28%', justifyContent: 'center', alignItems: 'center', paddingVertical: 10 }, disabled && { opacity: 0.35 }], children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: { paddingHorizontal: 6, paddingVertical: 3, borderRadius: 999, backgroundColor: isSelectedDay ? brandColor : dark ? '#383838' : '#fff' }, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: [dayTextStyle, { color: isSelectedDay ? '#fff' : dark ? '#fff' : '#000' }], children: language === 'np' ? (0, _config.getNepaliNumber)(day) : day }) }) }); }); var _default = exports.default = DayCell; //# sourceMappingURL=DayCell.js.map