|
@@ -34,7 +34,6 @@ const RegionItem = ({
|
|
? qualityOptions.find((q) => q.id === region.quality)?.name
|
|
? qualityOptions.find((q) => q.id === region.quality)?.name
|
|
: 'Good Visit';
|
|
: 'Good Visit';
|
|
const disabled = !startDate || startDate > new Date().toISOString().split('T')[0];
|
|
const disabled = !startDate || startDate > new Date().toISOString().split('T')[0];
|
|
- const completed = Boolean(endDate && endDate <= new Date().toISOString().split('T')[0]);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
<View key={region.id} style={styles.regionItem}>
|
|
<View key={region.id} style={styles.regionItem}>
|
|
@@ -72,19 +71,19 @@ const RegionItem = ({
|
|
<TouchableOpacity
|
|
<TouchableOpacity
|
|
style={[
|
|
style={[
|
|
styles.markCompletedButton,
|
|
styles.markCompletedButton,
|
|
- (disabled || completed) && {
|
|
|
|
|
|
+ (disabled) && {
|
|
backgroundColor: Colors.LIGHT_GRAY,
|
|
backgroundColor: Colors.LIGHT_GRAY,
|
|
borderColor: Colors.LIGHT_GRAY
|
|
borderColor: Colors.LIGHT_GRAY
|
|
}
|
|
}
|
|
]}
|
|
]}
|
|
onPress={onToggleStatus}
|
|
onPress={onToggleStatus}
|
|
- disabled={disabled || completed}
|
|
|
|
|
|
+ disabled={disabled}
|
|
>
|
|
>
|
|
<View style={styles.completedContainer}>
|
|
<View style={styles.completedContainer}>
|
|
<View style={{ position: 'relative' }}>
|
|
<View style={{ position: 'relative' }}>
|
|
<SquareSvg />
|
|
<SquareSvg />
|
|
</View>
|
|
</View>
|
|
- {((region.status === 1 && !disabled) || completed) && (
|
|
|
|
|
|
+ {(region.status === 1 && !disabled) && (
|
|
<View style={{ position: 'absolute', left: 2, top: 1 }}>
|
|
<View style={{ position: 'absolute', left: 2, top: 1 }}>
|
|
<CheckSvg width={14} height={14} />
|
|
<CheckSvg width={14} height={14} />
|
|
</View>
|
|
</View>
|