|
@@ -7,8 +7,7 @@
|
|
|
|
|
|
import { FontAwesome } from "@expo/vector-icons";
|
|
import { FontAwesome } from "@expo/vector-icons";
|
|
import React, { memo, useEffect, useRef, useState } from "react";
|
|
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 Modal from 'react-native-modal';
|
|
import { LMComment, useAddComment, useDeleteComment, useEditComment, useLandmarkComments } from "../../../../data/comments";
|
|
import { LMComment, useAddComment, useDeleteComment, useEditComment, useLandmarkComments } from "../../../../data/comments";
|
|
import { Landmark, useAddLandmarkPhoto, useDeleteLandmark, useDeleteLandmarkPhoto, useEditLandmark, useLandmark, useRateLandmark } from "../../../../data/landmarks";
|
|
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.
|
|
* Holds a reference to the Flatlist containing the comments.
|
|
*/
|
|
*/
|
|
const commentListRef = useRef<FlatList>();
|
|
const commentListRef = useRef<FlatList>();
|
|
|
|
+ const mainScrollRef = useRef<ScrollView>();
|
|
/**
|
|
/**
|
|
* Holds a reference to the text input for posting a new comment
|
|
* Holds a reference to the text input for posting a new comment
|
|
*/
|
|
*/
|
|
@@ -364,7 +364,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
</TouchableOpacity>
|
|
</TouchableOpacity>
|
|
<IconButton style={{alignSelf: 'flex-end', marginBottom: 20}} icon="trash" color="white" size={25} onPress={() => tryDeletePhoto(landmarkQuery?.data?.landmark?.photos[selectedImage].id)}/>
|
|
<IconButton style={{alignSelf: 'flex-end', marginBottom: 20}} icon="trash" color="white" size={25} onPress={() => tryDeletePhoto(landmarkQuery?.data?.landmark?.photos[selectedImage].id)}/>
|
|
</View>
|
|
</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}}/>
|
|
<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>
|
|
</ScrollView>
|
|
</View>
|
|
</View>
|
|
@@ -400,6 +400,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
landmark={landmarkQuery?.data?.landmark}
|
|
landmark={landmarkQuery?.data?.landmark}
|
|
updatedLandmark={updatedLandmark}
|
|
updatedLandmark={updatedLandmark}
|
|
commentListRef={commentListRef}
|
|
commentListRef={commentListRef}
|
|
|
|
+ mainScrollRef={mainScrollRef}
|
|
commentTextInputRef={commentTextInputRef}
|
|
commentTextInputRef={commentTextInputRef}
|
|
commentBeingEdited={commentBeingEdited}
|
|
commentBeingEdited={commentBeingEdited}
|
|
comments={commentsQuery?.data}
|
|
comments={commentsQuery?.data}
|