|
|
@@ -8,6 +8,8 @@ import { styles } from './styles';
|
|
|
|
|
|
import TrashSvg from 'assets/icons/travels-screens/trash-solid.svg';
|
|
|
import CalendarSvg from 'assets/icons/calendar.svg';
|
|
|
+import TransitSvg from 'assets/icons/transit.svg';
|
|
|
+import Tooltip from 'react-native-walkthrough-tooltip';
|
|
|
|
|
|
interface RegionItemProps {
|
|
|
region: RegionAddData;
|
|
|
@@ -39,6 +41,7 @@ const RegionItem = ({
|
|
|
const [name, ...rest] = region.region_name?.split(/ – | - /);
|
|
|
const subname = rest?.join(' - ');
|
|
|
const [datesTooLong, setDatesTooLong] = useState(false);
|
|
|
+ const [toolTipVisible, setToolTipVisible] = useState<boolean>(false);
|
|
|
|
|
|
return (
|
|
|
<View key={region.id} style={styles.regionItem}>
|
|
|
@@ -83,7 +86,7 @@ const RegionItem = ({
|
|
|
style={[
|
|
|
styles.dateText,
|
|
|
(!region?.visitStartDate?.year || !region?.visitEndDate?.year) &&
|
|
|
- styles.placeholderText
|
|
|
+ styles.placeholderText
|
|
|
]}
|
|
|
numberOfLines={2}
|
|
|
onTextLayout={(e) => {
|
|
|
@@ -95,13 +98,42 @@ const RegionItem = ({
|
|
|
}}
|
|
|
>
|
|
|
{datesTooLong &&
|
|
|
- region?.visitStartDate?.year &&
|
|
|
- region?.visitEndDate?.year &&
|
|
|
- startLabel !== endLabel
|
|
|
+ region?.visitStartDate?.year &&
|
|
|
+ region?.visitEndDate?.year &&
|
|
|
+ startLabel !== endLabel
|
|
|
? `${startLabel}\n${endLabel}`
|
|
|
: (datesLabel ?? 'Select visit dates')}
|
|
|
</Text>
|
|
|
</TouchableOpacity>
|
|
|
+ {region.quality === 1 ? (
|
|
|
+ <Tooltip
|
|
|
+ isVisible={toolTipVisible}
|
|
|
+ content={
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ fontSize: 12,
|
|
|
+ color: Colors.DARK_BLUE,
|
|
|
+ fontStyle: 'italic',
|
|
|
+ fontWeight: '600'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ Transit
|
|
|
+ </Text>
|
|
|
+ }
|
|
|
+ contentStyle={{ backgroundColor: Colors.WHITE }}
|
|
|
+ placement="top"
|
|
|
+ onClose={() => setToolTipVisible(false)}
|
|
|
+ backgroundColor="transparent"
|
|
|
+ allowChildInteraction={false}
|
|
|
+ >
|
|
|
+ <TouchableOpacity
|
|
|
+ onPress={() => setToolTipVisible(true)}
|
|
|
+ hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
|
+ >
|
|
|
+ <TransitSvg fill={Colors.DARK_BLUE} width={24} height={24} />
|
|
|
+ </TouchableOpacity>
|
|
|
+ </Tooltip>
|
|
|
+ ) : null}
|
|
|
</View>
|
|
|
|
|
|
{errorMessage ? (
|