|
@@ -7,21 +7,24 @@ import { Colors } from 'src/theme';
|
|
|
import { API_HOST } from 'src/constants';
|
|
|
import { styles } from './styles';
|
|
|
|
|
|
-import MarkIcon from 'assets/icons/mark.svg';
|
|
|
import TrashSvg from 'assets/icons/travels-screens/trash-solid.svg';
|
|
|
import ChevronIcon from 'assets/icons/travels-screens/down-arrow.svg';
|
|
|
+import CheckSvg from 'assets/icons/travels-screens/check.svg';
|
|
|
+import SquareSvg from 'assets/icons/travels-screens/square.svg';
|
|
|
|
|
|
const RegionItem = ({
|
|
|
region,
|
|
|
onDelete,
|
|
|
onToggleStatus,
|
|
|
onQualityChange,
|
|
|
+ onHiddenChange,
|
|
|
startDate
|
|
|
}: {
|
|
|
region: RegionAddData;
|
|
|
onDelete: () => void;
|
|
|
onToggleStatus: () => void;
|
|
|
onQualityChange: () => void;
|
|
|
+ onHiddenChange: () => void;
|
|
|
startDate: string | null;
|
|
|
}) => {
|
|
|
const name = region.region_name.split(/ – | - /);
|
|
@@ -64,30 +67,57 @@ const RegionItem = ({
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<TouchableOpacity
|
|
|
- style={
|
|
|
- region.status === 1 && !disabled
|
|
|
- ? styles.markNotCompletedButton
|
|
|
- : [
|
|
|
- styles.markCompletedButton,
|
|
|
- disabled && {
|
|
|
- backgroundColor: Colors.LIGHT_GRAY,
|
|
|
- borderColor: Colors.LIGHT_GRAY
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
+ style={[
|
|
|
+ styles.markCompletedButton,
|
|
|
+ disabled && {
|
|
|
+ backgroundColor: Colors.LIGHT_GRAY,
|
|
|
+ borderColor: Colors.LIGHT_GRAY
|
|
|
+ }
|
|
|
+ ]}
|
|
|
onPress={onToggleStatus}
|
|
|
disabled={disabled}
|
|
|
>
|
|
|
- {region.status === 1 && !disabled ? (
|
|
|
- <View style={styles.completedContainer}>
|
|
|
- <MarkIcon width={16} height={16} />
|
|
|
- <Text style={styles.markNotCompletedButtonText}>Completed</Text>
|
|
|
+ <View style={styles.completedContainer}>
|
|
|
+ <View style={{ position: 'relative' }}>
|
|
|
+ <SquareSvg />
|
|
|
</View>
|
|
|
- ) : (
|
|
|
- <Text style={[styles.markCompletedButtonText]}>Mark Completed</Text>
|
|
|
- )}
|
|
|
+ {region.status === 1 && !disabled && (
|
|
|
+ <View style={{ position: 'absolute', left: 2, top: 1 }}>
|
|
|
+ <CheckSvg width={14} height={14} />
|
|
|
+ </View>
|
|
|
+ )}
|
|
|
+ <Text style={styles.markCompletedButtonText}>Completed</Text>
|
|
|
+ </View>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
+ {region.can_be_hidden && (
|
|
|
+ <View style={{ marginTop: 12, marginHorizontal: '25%' }}>
|
|
|
+ <TouchableOpacity
|
|
|
+ style={[
|
|
|
+ styles.markCompletedButton,
|
|
|
+ disabled && {
|
|
|
+ backgroundColor: Colors.LIGHT_GRAY,
|
|
|
+ borderColor: Colors.LIGHT_GRAY
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ onPress={onHiddenChange}
|
|
|
+ disabled={disabled}
|
|
|
+ >
|
|
|
+ <View style={styles.completedContainer}>
|
|
|
+ <View style={{ position: 'relative' }}>
|
|
|
+ <SquareSvg />
|
|
|
+ </View>
|
|
|
+ {region.hidden && (
|
|
|
+ <View style={{ position: 'absolute', left: 2, top: 1 }}>
|
|
|
+ <CheckSvg width={14} height={14} />
|
|
|
+ </View>
|
|
|
+ )}
|
|
|
+
|
|
|
+ <Text style={styles.markCompletedButtonText}>Hidden</Text>
|
|
|
+ </View>
|
|
|
+ </TouchableOpacity>
|
|
|
+ </View>
|
|
|
+ )}
|
|
|
</View>
|
|
|
);
|
|
|
};
|