|
@@ -8,6 +8,8 @@ import RotateSvg from 'assets/icons/travels-screens/rotate.svg';
|
|
import { styles } from './style';
|
|
import { styles } from './style';
|
|
import React from 'react';
|
|
import React from 'react';
|
|
import { Colors } from 'src/theme';
|
|
import { Colors } from 'src/theme';
|
|
|
|
+import { useNavigation } from '@react-navigation/native';
|
|
|
|
+import { NAVIGATION_PAGES } from 'src/types';
|
|
|
|
|
|
interface Region {
|
|
interface Region {
|
|
id: number;
|
|
id: number;
|
|
@@ -36,6 +38,7 @@ const RegionPopup: React.FC<RegionPopupProps> = ({
|
|
disabled
|
|
disabled
|
|
}) => {
|
|
}) => {
|
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
|
|
+ const navigation = useNavigation();
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
Animated.timing(fadeAnim, {
|
|
Animated.timing(fadeAnim, {
|
|
@@ -46,10 +49,11 @@ const RegionPopup: React.FC<RegionPopupProps> = ({
|
|
}, [fadeAnim]);
|
|
}, [fadeAnim]);
|
|
|
|
|
|
const splitRegionName = (fullName: string) => {
|
|
const splitRegionName = (fullName: string) => {
|
|
- const parts = fullName.split(/ – | - /);
|
|
|
|
|
|
+ const [name, ...rest] = fullName?.split(/ – | - /);
|
|
|
|
+ const subname = rest?.join(' - ');
|
|
return {
|
|
return {
|
|
- regionTitle: parts[0],
|
|
|
|
- regionSubtitle: parts.length > 1 ? parts[1] : ''
|
|
|
|
|
|
+ regionTitle: name,
|
|
|
|
+ regionSubtitle: subname ? subname : ''
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
|