Переглянути джерело

Merge branch 'global-alerts' of ericCNP:apps/atlas-mobile-ts into global-alerts

Eric Li 2 роки тому
батько
коміт
13787c4c38

+ 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
@@ -216,8 +216,8 @@ const IndoorMap: React.FC<IndoorMapProps> = ({ navigation, landmarks, promptAddL
               }}
               >
                 {/* {firstTime == true ? undefined : loadCircles} */}
-                {loadCircles}
                 <IndoorFloor floorNum={floor} />
+                {loadLandmarks}
               </Svg>
             </ReactNativeZoomableView>
           }

+ 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;

+ 3 - 3
src/utils/RequestUtils.ts

@@ -25,8 +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'
 
-//export const API_URL = 'http://192.168.3.102:8000'   // 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.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 = Config.API_URL