import * as React from 'react' import { StyleSheet, View } from 'react-native' import { daySize } from './dateUtils' function DayRange({ leftCrop, rightCrop, inRange, selectColor, }: { leftCrop: boolean rightCrop: boolean inRange: boolean selectColor: string }) { const bothWays = inRange && leftCrop && rightCrop const isCrop = inRange && (leftCrop || rightCrop) && !(leftCrop && rightCrop) if (inRange || isCrop) { return ( {isCrop && ( <> )} ) } return null } const styles = StyleSheet.create({ leftRadius: { borderBottomLeftRadius: daySize / 2, borderTopLeftRadius: daySize / 2, }, rightRadius: { borderBottomRightRadius: daySize / 2, borderTopRightRadius: daySize / 2, }, rangeRootBoth: { borderRadius: daySize / 2, }, flex1: { flex: 1, }, rangeRoot: { flexDirection: 'row', }, rightCrop: { flexBasis: 5, }, }) export default React.memo(DayRange)