UNPKG

react-native-nepali-picker

Version:

Minimalist and modern Nepali-date picker with customization.🌟

52 lines (51 loc) • 1.29 kB
"use strict"; import React from 'react'; import { Text, TouchableOpacity, View } from 'react-native'; import { getNepaliNumber } from "./calendar/config.js"; import { jsx as _jsx } from "react/jsx-runtime"; const DayCell = /*#__PURE__*/React.memo(({ day, isSelectedDay, onPress, dark, brandColor, language, dayTextStyle, disabled }) => { if (!day) { return /*#__PURE__*/_jsx(View, { style: { width: '14.28%', paddingVertical: 10 } }); } return /*#__PURE__*/_jsx(TouchableOpacity, { onPress: () => !disabled && onPress(day), style: [{ width: '14.28%', justifyContent: 'center', alignItems: 'center', paddingVertical: 10 }, disabled && { opacity: 0.35 }], children: /*#__PURE__*/_jsx(View, { style: { paddingHorizontal: 6, paddingVertical: 3, borderRadius: 999, backgroundColor: isSelectedDay ? brandColor : dark ? '#383838' : '#fff' }, children: /*#__PURE__*/_jsx(Text, { style: [dayTextStyle, { color: isSelectedDay ? '#fff' : dark ? '#fff' : '#000' }], children: language === 'np' ? getNepaliNumber(day) : day }) }) }); }); export default DayCell; //# sourceMappingURL=DayCell.js.map