瀏覽代碼

tried to fix indoor landmark bugs

Aidan Gironella 1 年之前
父節點
當前提交
c6d2ff49f1

+ 2 - 1
.vscode/settings.json

@@ -1,5 +1,6 @@
 {
     "java.configuration.updateBuildConfiguration": "interactive",
     "python.linting.pylintEnabled": true,
-    "python.linting.enabled": true
+    "python.linting.enabled": true,
+    "typescript.tsdk": "node_modules\\typescript\\lib"
 }

+ 4 - 2
app.json

@@ -43,11 +43,13 @@
     "web": {
       "favicon": "./assets/favicon.png"
     },
-    "runtimeVersion": "1.0.1",
+    "runtimeVersion": {
+      "policy": "sdkVersion"
+    },
     "extra": {
       "eas": {
         "projectId": "082de7a5-d9b8-4c96-bd1b-5706cca20324"
       }
     }
   }
-}
+}

File diff suppressed because it is too large
+ 542 - 1367
package-lock.json


+ 6 - 0
src/components/Map/Panels/LandmarkDetailsPanel/DetailsHeader.tsx

@@ -139,6 +139,12 @@ export const DetailsHeader: React.FC<DetailsHeaderProps> = (props) => {
                         </TouchableOpacity>}
                     <View style={{ flexDirection: 'row' }}>
                         <Report isLandmark = {true} landmark = {props.landmark} />
+                            <TouchOpaq
+                                func={() => props.removeLandmark()}
+                                size={25}
+                                col={"white"}
+                                name={"trash"}
+                            />
                         <TouchOpaq
                             func={() => props.toggleDetailsPanel(false)}
                             col={"white"}

+ 11 - 8
src/components/Map/Panels/LandmarkDetailsPanel/Report.tsx

@@ -11,12 +11,9 @@ import { useState } from "react"
 import { Alert, Text, StyleSheet, Pressable, TextInput, TouchableOpacity, View, Keyboard } from "react-native"
 import Modal from "react-native-modal"
 import Select from "react-native-multiple-select"
-import { useAuth } from "../../../../data/Auth/AuthContext"
 import { LMComment } from "../../../../data/comments"
 import { Landmark } from "../../../../data/landmarks"
 
-import { lmTypes as allLmTypes, lmTypesIndoor, catTypes } from "../../../../utils/GlobalUtils";
-
 
 interface ReportProps {
     landmark?: Landmark,
@@ -25,7 +22,6 @@ interface ReportProps {
 }
 
 export const Report: React.FC<ReportProps> = (props) => {
-    let lmTypes = lmTypesIndoor
 
     const [keyboardIsVisible, setKeyboardIsVisible] = useState(false)
     useEffect(() => {
@@ -46,7 +42,6 @@ export const Report: React.FC<ReportProps> = (props) => {
         setModalVisible(!modalVisible)
     }
 
-    const { landmarkOwnedByUser, anonUserId, setAlert } = useAuth()
     const sendReport = () => {
         var report = props.isLandmark ?
             "Report submitted for landmark '" + props.landmark?.title + "':\n\tID: " + props.landmark?.id
@@ -64,7 +59,7 @@ export const Report: React.FC<ReportProps> = (props) => {
         }
         text ? report += "Extra comments: " + text : null
         console.log(report)
-        Alert.alert('Report submitted', 'Thank you for making the Atlas a safer place!')
+        Alert.alert('Report submitted', 'Thank you for making The Atlas a safer place!')
         setModalVisible(!modalVisible)
         // console.log((landmarkOwnedByUser(props.landmark)))
     }
@@ -97,7 +92,6 @@ export const Report: React.FC<ReportProps> = (props) => {
         setSelectedReasons(selectedReasons)
         for (let i = 0; i < selectedReasons.length; i++) {
             var tempItem = reasons.find(item => item.value === selectedReasons[i])
-            console.log(tempItem)
         }
     }
 
@@ -161,7 +155,16 @@ export const Report: React.FC<ReportProps> = (props) => {
                         </Pressable>
                         <Pressable
                             style={styles.submit}
-                            onPress={sendReport}>
+                            onPress={() =>
+                                Alert.alert(
+                                    'Are you sure you want to submit this report?',
+                                    'This action cannot be undone.',
+                                    [
+                                        { text: 'Cancel', onPress: () => console.log('Report cancelled'), style: 'cancel' },
+                                        { text: 'OK', onPress: sendReport },
+                                    ],
+                                    { cancelable: false }
+                                )}>
                             <Text style={{ color: 'white', textAlign: 'center' }}>Submit</Text>
                         </Pressable>
                     </View>}

+ 3 - 2
src/utils/RequestUtils.ts

@@ -11,10 +11,11 @@
 //export const API_URL = 'http://192.168.3.81:8000'
 // export const API_URL = 'https://staging.clicknpush.ca'
 
-export const API_URL = 'https://app.clicknpush.ca'
+// export const API_URL = 'https://app.clicknpush.ca'
 // export const API_URL = 'http://192.168.1.106:8000' // Nathan
 //export const API_URL = 'http://192.168.1.64:8000'   // Chase
 //export const API_URL = 'http://192.168.0.22:8000'       // Eric
-// export const API_URL = 'http://172.31.0.1:8000'       // Aidan
+export const API_URL = 'http://192.168.1.130:8000'  // Aidan surface
+// export const API_URL = 'http://'  // Aidan home
 
 // export const API_URL = Config.API_URL

Some files were not shown because too many files changed in this diff