Pārlūkot izejas kodu

fixed landmark deletion and ios indoor landmark selection

chase 2 gadi atpakaļ
vecāks
revīzija
a055151f06

+ 7 - 6
src/components/Map/IndoorFloor.tsx

@@ -1,5 +1,6 @@
 import { View, Text } from 'react-native'
 import React from 'react'
+import { Image } from 'react-native-svg'
 import BasementC from './MainMapComponent/images/BasementC.svg'
 import FirstFloorC from './MainMapComponent/images/FirstFloorC.svg'
 import SecondFloorC from './MainMapComponent/images/SecondFloorC.svg'
@@ -10,12 +11,12 @@ import FifthFloorC from './MainMapComponent/images/FifthFloorC.svg'
 // export const IndoorFloor: React.FC<{floorNum: number}> = (props) => {
 function IndoorFloor(props) {
   const compArray = [
-      <BasementC style={{ opacity: 0.7 }} height={"100%"} width={"100%"} />,
-      <FirstFloorC style={{ opacity: 0.7 }} height={"100%"} width={"100%"} />,
-      <SecondFloorC style={{ opacity: 0.7 }} height={"100%"} width={"100%"} />,
-      <ThirdFloorC viewBox='250 136 310 310' style={{ opacity: 0.7 }} height={"100%"} width={"100%"} />,
-      <FourthFloorC viewBox='260 151 270 260' style={{ opacity: 0.7 }} height={"100%"} width={"100%"} />,
-      <FifthFloorC viewBox='257 153 270 290' style={{ opacity: 0.7 }} height={"100%"} width={"100%"} />,
+    <Image height={"100%"} width={"100%"} href={require('./MainMapComponent/images/basement.png')} />,
+    <Image height={'100%'} width="100%" href={require('./MainMapComponent/images/firstfloor.png')} />,
+    <Image height={"100%"} width={"100%"} href={require('./MainMapComponent/images/secondfloor.png')} />,
+    <Image height={"100%"} width={"100%"} href={require('./MainMapComponent/images/thirdfloor.png')} />,
+    <Image height={"100%"} width={"100%"} href={require('./MainMapComponent/images/fourthfloor.png')} />,
+    <Image height={"100%"} width={"100%"} href={require('./MainMapComponent/images/fifthfloor.png')} />,
   ]
 
   return compArray[props.floorNum]

+ 2 - 2
src/components/Map/MainMapComponent/IndoorMap.tsx

@@ -42,7 +42,7 @@ const IndoorMap: React.FC<IndoorMapProps> = ({ navigation, landmarks, promptAddL
 
   const imageDim = 0.05 * Dimensions.get("window").width;
 
-  const loadCircles = applyFilter(landmarks)?.map((item) => {
+  const loadLandmarks = applyFilter(landmarks)?.map((item) => {
     if (item.floor == floor && SVGdim[0] != 1 && SVGdim[1] != 1) {
       return (
         <Image
@@ -215,8 +215,8 @@ const IndoorMap: React.FC<IndoorMapProps> = ({ navigation, landmarks, promptAddL
               }}
               >
                 {/* {firstTime == true ? undefined : loadCircles} */}
-                {loadCircles}
                 <IndoorFloor floorNum={floor} />
+                {loadLandmarks}
               </Svg>
             </ReactNativeZoomableView>
           }

+ 0 - 8
src/data/Auth/AuthContext.tsx

@@ -118,19 +118,11 @@ export const AuthContextProvider: React.FC = ({children}) => {
                         authorized: false,
                         errorMessage: 'Failed to retrieve user data from server'})
 
-<<<<<<< HEAD
                     if (response.status == 200) {
-=======
-                    if (response.status === 200) {
->>>>>>> a21b27df012bca6468d78c33a54c88ef7d8156c9
                         setAccessToken(accessTokenFromStorage)
                         setRefreshToken(await getItemAsync(SECURESTORE_REFRESHTOKEN))
                         setNotificationToken(await getItemAsync(SECURESTORE_NOTIFTOKEN))
                         setUserId(await getItemAsync(SECURESTORE_ID))
-<<<<<<< HEAD
-                        setAnonUserId('')
-=======
->>>>>>> a21b27df012bca6468d78c33a54c88ef7d8156c9
                         return
                     }
                 }

+ 3 - 2
src/data/landmarks.ts

@@ -232,11 +232,12 @@ export const useDeleteLandmark = () => {
             }
 
             if (!accessToken) config.data = {...config.data, anonymous: anonUserId}
-            
+
+            console.log(config)
 
             const response = await sendApiRequestAsync({
                 axiosConfig: config,
-                authorized: false,
+                authorized: !!accessToken,
                 errorMessage: 'Something went wrong when deleting a landmark'
             });   
             return response?.data;

+ 2 - 7
src/utils/RequestUtils.ts

@@ -25,13 +25,8 @@ import Config from 'react-native-config'
 //export const API_URL = 'http://192.168.3.81:8000'
 // export const API_URL = 'https://staging.clicknpush.ca'
 
-<<<<<<< HEAD
-//export const API_URL = 'http://192.168.3.102:8000'   // Chase
+export const API_URL = 'http://192.168.3.102:8001'   // Chase
 //export const API_URL = 'http://192.168.0.22:8000'       // Eric
-export const API_URL = 'https://app.clicknpush.ca'
-=======
-// export const API_URL = 'http://192.168.3.162:8000'   // Chase
-export const API_URL = 'https://app.clicknpush.ca'       // Eric
->>>>>>> a21b27df012bca6468d78c33a54c88ef7d8156c9
+//export const API_URL = 'https://app.clicknpush.ca'
 
 // export const API_URL = Config.API_URL