Loading mobile/package-lock.json +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ "expo-checkbox": "~2.7.0", "expo-constants": "~15.4.5", "expo-image-picker": "~14.7.1", "expo-linear-gradient": "~12.7.2", "expo-linking": "~6.2.2", "expo-localization": "~14.8.4", "expo-router": "~3.4.8", Loading Loading @@ -8869,6 +8870,14 @@ "expo": "*" } }, "node_modules/expo-linear-gradient": { "version": "12.7.2", "resolved": "https://registry.npmjs.org/expo-linear-gradient/-/expo-linear-gradient-12.7.2.tgz", "integrity": "sha512-Wwb2EF18ywgrlTodcXJ6Yt/UEcKitRMdXPNyP/IokmeKh4emoq9DxZJpZdkXm3HUTLlbRpi6/t32jrFVqXB9AQ==", "peerDependencies": { "expo": "*" } }, "node_modules/expo-linking": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/expo-linking/-/expo-linking-6.2.2.tgz", Loading mobile/package.json +2 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,8 @@ "react-native-screens": "~3.29.0", "react-native-svg": "14.1.0", "@react-native-picker/picker": "2.6.1", "@react-native-async-storage/async-storage": "1.21.0" "@react-native-async-storage/async-storage": "1.21.0", "expo-linear-gradient": "~12.7.2" }, "devDependencies": { "@babel/core": "^7.20.0", Loading mobile/src/common/components/animated_background.tsx +10 −13 Original line number Diff line number Diff line import { Animated, Image, View } from "react-native"; import { PlaceInfoEntity } from "../../domain/entities/place_info_entity"; import { useAnimatedSelectedIndex } from "../../hooks/useAnimatedSelectedIndex"; import { LinearGradient } from "expo-linear-gradient"; import { LIGHT_THEME } from "../constants/theme"; interface AnimatedBackgroundProps { imageUri?: string; backgroundImageAnimation: Animated.Value; }; } export const AnimatedBackground = ({ imageUri, backgroundImageAnimation }: AnimatedBackgroundProps) => { export const AnimatedBackground = ({ imageUri, backgroundImageAnimation, }: AnimatedBackgroundProps) => { return ( <Animated.View style={{ Loading @@ -17,7 +22,7 @@ export const AnimatedBackground = ({ imageUri, backgroundImageAnimation }: Anima opacity: backgroundImageAnimation.interpolate({ inputRange: [-300, 0], outputRange: [0, 1], }) }), }} > <Image Loading @@ -38,14 +43,6 @@ export const AnimatedBackground = ({ imageUri, backgroundImageAnimation }: Anima }).start(); }} /> <View style={{ position: "absolute", width: "100%", height: "100%", backgroundColor: "rgba(0, 0, 0, 0.4)", }} /> </Animated.View> ); }; mobile/src/common/components/caroussel/caroussel.tsx +61 −54 Original line number Diff line number Diff line import { View, Animated, Text, Dimensions, Image, NativeSyntheticEvent, NativeScrollEvent } from "react-native"; import { View, Animated, Text, Dimensions, Image, NativeSyntheticEvent, NativeScrollEvent, } from "react-native"; import { PlaceInfoEntity } from "../../../domain/entities/place_info_entity"; import { useRef } from "react"; import { StateDataSource } from "../../../domain/datasources/state_datasource"; import { CarousselTile } from "./caroussel_tile"; import { router } from "expo-router"; import { BLANK_ITEM_WIDTH, ITEM_WIDTH } from "../../constants/caroussel"; interface CarousselProps { data: PlaceInfoEntity[]; Loading @@ -11,9 +20,6 @@ interface CarousselProps { onIndexChange?: (index: number) => void; } const ITEM_WIDTH = Dimensions.get("window").width * 0.7; const BLANK_ITEM_WIDTH = Dimensions.get("window").width * 0.15; export const Caroussel = ({ data, onPress, onIndexChange }: CarousselProps) => { const scrollX = useRef(new Animated.Value(0)).current; const finalData = [ Loading Loading @@ -43,12 +49,14 @@ export const Caroussel = ({ data, onPress, onIndexChange }: CarousselProps) => { showsHorizontalScrollIndicator={false} decelerationRate={0} initialNumToRender={1} bounces={false} snapToInterval={ITEM_WIDTH} onScroll={Animated.event([{ nativeEvent: { contentOffset: { x: scrollX } } }], { onScroll={Animated.event( [{ nativeEvent: { contentOffset: { x: scrollX } } }], { useNativeDriver: true, })} } )} renderItem={({ item, index }) => { if (item.id === -1 || item.id === -2) { return <View style={{ width: BLANK_ITEM_WIDTH }} />; Loading Loading @@ -82,8 +90,7 @@ export const Caroussel = ({ data, onPress, onIndexChange }: CarousselProps) => { if (item.id !== -1 && item.id !== -2) { onPress && onPress(item.id); } } } }} /> ); }} Loading mobile/src/common/components/caroussel/caroussel_tile.tsx +1 −4 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import { } from "react-native"; import { PlaceInfoEntity } from "../../../domain/entities/place_info_entity"; import { Link } from "expo-router"; import { ITEM_HEIGHT, ITEM_WIDTH } from "../../constants/caroussel"; interface CarousselTileProps { onPress?: () => void; Loading @@ -18,10 +19,6 @@ interface CarousselTileProps { opacity: Animated.AnimatedInterpolation<number>; } const ITEM_WIDTH = Dimensions.get("window").width * 0.7; const BLANK_ITEM_WIDTH = Dimensions.get("window").width * 0.15; const ITEM_HEIGHT = Dimensions.get("window").height * 0.7; export const CarousselTile = memo( ({ translateY, scale, opacity, item, onPress }: CarousselTileProps) => { return ( Loading Loading
mobile/package-lock.json +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ "expo-checkbox": "~2.7.0", "expo-constants": "~15.4.5", "expo-image-picker": "~14.7.1", "expo-linear-gradient": "~12.7.2", "expo-linking": "~6.2.2", "expo-localization": "~14.8.4", "expo-router": "~3.4.8", Loading Loading @@ -8869,6 +8870,14 @@ "expo": "*" } }, "node_modules/expo-linear-gradient": { "version": "12.7.2", "resolved": "https://registry.npmjs.org/expo-linear-gradient/-/expo-linear-gradient-12.7.2.tgz", "integrity": "sha512-Wwb2EF18ywgrlTodcXJ6Yt/UEcKitRMdXPNyP/IokmeKh4emoq9DxZJpZdkXm3HUTLlbRpi6/t32jrFVqXB9AQ==", "peerDependencies": { "expo": "*" } }, "node_modules/expo-linking": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/expo-linking/-/expo-linking-6.2.2.tgz", Loading
mobile/package.json +2 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,8 @@ "react-native-screens": "~3.29.0", "react-native-svg": "14.1.0", "@react-native-picker/picker": "2.6.1", "@react-native-async-storage/async-storage": "1.21.0" "@react-native-async-storage/async-storage": "1.21.0", "expo-linear-gradient": "~12.7.2" }, "devDependencies": { "@babel/core": "^7.20.0", Loading
mobile/src/common/components/animated_background.tsx +10 −13 Original line number Diff line number Diff line import { Animated, Image, View } from "react-native"; import { PlaceInfoEntity } from "../../domain/entities/place_info_entity"; import { useAnimatedSelectedIndex } from "../../hooks/useAnimatedSelectedIndex"; import { LinearGradient } from "expo-linear-gradient"; import { LIGHT_THEME } from "../constants/theme"; interface AnimatedBackgroundProps { imageUri?: string; backgroundImageAnimation: Animated.Value; }; } export const AnimatedBackground = ({ imageUri, backgroundImageAnimation }: AnimatedBackgroundProps) => { export const AnimatedBackground = ({ imageUri, backgroundImageAnimation, }: AnimatedBackgroundProps) => { return ( <Animated.View style={{ Loading @@ -17,7 +22,7 @@ export const AnimatedBackground = ({ imageUri, backgroundImageAnimation }: Anima opacity: backgroundImageAnimation.interpolate({ inputRange: [-300, 0], outputRange: [0, 1], }) }), }} > <Image Loading @@ -38,14 +43,6 @@ export const AnimatedBackground = ({ imageUri, backgroundImageAnimation }: Anima }).start(); }} /> <View style={{ position: "absolute", width: "100%", height: "100%", backgroundColor: "rgba(0, 0, 0, 0.4)", }} /> </Animated.View> ); };
mobile/src/common/components/caroussel/caroussel.tsx +61 −54 Original line number Diff line number Diff line import { View, Animated, Text, Dimensions, Image, NativeSyntheticEvent, NativeScrollEvent } from "react-native"; import { View, Animated, Text, Dimensions, Image, NativeSyntheticEvent, NativeScrollEvent, } from "react-native"; import { PlaceInfoEntity } from "../../../domain/entities/place_info_entity"; import { useRef } from "react"; import { StateDataSource } from "../../../domain/datasources/state_datasource"; import { CarousselTile } from "./caroussel_tile"; import { router } from "expo-router"; import { BLANK_ITEM_WIDTH, ITEM_WIDTH } from "../../constants/caroussel"; interface CarousselProps { data: PlaceInfoEntity[]; Loading @@ -11,9 +20,6 @@ interface CarousselProps { onIndexChange?: (index: number) => void; } const ITEM_WIDTH = Dimensions.get("window").width * 0.7; const BLANK_ITEM_WIDTH = Dimensions.get("window").width * 0.15; export const Caroussel = ({ data, onPress, onIndexChange }: CarousselProps) => { const scrollX = useRef(new Animated.Value(0)).current; const finalData = [ Loading Loading @@ -43,12 +49,14 @@ export const Caroussel = ({ data, onPress, onIndexChange }: CarousselProps) => { showsHorizontalScrollIndicator={false} decelerationRate={0} initialNumToRender={1} bounces={false} snapToInterval={ITEM_WIDTH} onScroll={Animated.event([{ nativeEvent: { contentOffset: { x: scrollX } } }], { onScroll={Animated.event( [{ nativeEvent: { contentOffset: { x: scrollX } } }], { useNativeDriver: true, })} } )} renderItem={({ item, index }) => { if (item.id === -1 || item.id === -2) { return <View style={{ width: BLANK_ITEM_WIDTH }} />; Loading Loading @@ -82,8 +90,7 @@ export const Caroussel = ({ data, onPress, onIndexChange }: CarousselProps) => { if (item.id !== -1 && item.id !== -2) { onPress && onPress(item.id); } } } }} /> ); }} Loading
mobile/src/common/components/caroussel/caroussel_tile.tsx +1 −4 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import { } from "react-native"; import { PlaceInfoEntity } from "../../../domain/entities/place_info_entity"; import { Link } from "expo-router"; import { ITEM_HEIGHT, ITEM_WIDTH } from "../../constants/caroussel"; interface CarousselTileProps { onPress?: () => void; Loading @@ -18,10 +19,6 @@ interface CarousselTileProps { opacity: Animated.AnimatedInterpolation<number>; } const ITEM_WIDTH = Dimensions.get("window").width * 0.7; const BLANK_ITEM_WIDTH = Dimensions.get("window").width * 0.15; const ITEM_HEIGHT = Dimensions.get("window").height * 0.7; export const CarousselTile = memo( ({ translateY, scale, opacity, item, onPress }: CarousselTileProps) => { return ( Loading