|
@@ -7,8 +7,7 @@
|
|
|
|
|
|
import { FontAwesome } from "@expo/vector-icons";
|
|
|
import React, { memo, useEffect, useRef, useState } from "react";
|
|
|
-import { ActivityIndicator, Alert, Dimensions, FlatList, Image, Keyboard, Platform, SafeAreaView, StyleSheet, Text, TextInput, TouchableOpacity, View } from "react-native";
|
|
|
-import { ScrollView } from "react-native-gesture-handler";
|
|
|
+import { ScrollView, ActivityIndicator, Alert, Dimensions, FlatList, Image, Keyboard, Platform, SafeAreaView, StyleSheet, Text, TextInput, TouchableOpacity, View } from "react-native";
|
|
|
import Modal from 'react-native-modal';
|
|
|
import { LMComment, useAddComment, useDeleteComment, useEditComment, useLandmarkComments } from "../../../../data/comments";
|
|
|
import { Landmark, useAddLandmarkPhoto, useDeleteLandmark, useDeleteLandmarkPhoto, useEditLandmark, useLandmark, useRateLandmark } from "../../../../data/landmarks";
|
|
@@ -109,6 +108,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
|
* Holds a reference to the Flatlist containing the comments.
|
|
|
*/
|
|
|
const commentListRef = useRef<FlatList>();
|
|
|
+ const mainScrollRef = useRef<ScrollView>();
|
|
|
/**
|
|
|
* Holds a reference to the text input for posting a new comment
|
|
|
*/
|
|
@@ -364,7 +364,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
|
</TouchableOpacity>
|
|
|
<IconButton style={{alignSelf: 'flex-end', marginBottom: 20}} icon="trash" color="white" size={25} onPress={() => tryDeletePhoto(landmarkQuery?.data?.landmark?.photos[selectedImage].id)}/>
|
|
|
</View>
|
|
|
- <ScrollView style={{width: '100%', }}>
|
|
|
+ <ScrollView style={{width: '100%', }} ref={mainScrollRef}>
|
|
|
<Image style={{resizeMode: 'contain', alignSelf: 'center', height: Dimensions.get('window').height * .9, width: getWindowWidth()}} source={{uri: 'data:image/png;base64,' + landmarkQuery?.data?.landmark?.photos[selectedImage].image_b64}}/>
|
|
|
</ScrollView>
|
|
|
</View>
|
|
@@ -400,6 +400,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
|
landmark={landmarkQuery?.data?.landmark}
|
|
|
updatedLandmark={updatedLandmark}
|
|
|
commentListRef={commentListRef}
|
|
|
+ mainScrollRef={mainScrollRef}
|
|
|
commentTextInputRef={commentTextInputRef}
|
|
|
commentBeingEdited={commentBeingEdited}
|
|
|
comments={commentsQuery?.data}
|