瀏覽代碼

merged nathans changes

chase 2 年之前
父節點
當前提交
59a93a03a1

+ 2 - 2
.env

@@ -1,7 +1,7 @@
 SPOKESTACK_ID=c361ff3a-70c3-42e6-b0ee-0207edd03b18
 SPOKESTACK_TOKEN=1A8196594C401EB93035CC6D7D6328CF1855C2B359744E720953AC34B6F658CA
 
-API_URL=http://192.168.0.22:8000
+#API_URL=http://192.168.0.22:8000
 
-#API_URL=https://app.clicknpush.ca
+API_URL=https://app.clicknpush.ca
 

+ 3 - 0
.gitignore

@@ -73,4 +73,7 @@ buck-out/
 .expo/
 web-build/
 
+# EAS
+dist/
+
 # @end expo-cli

+ 3 - 0
.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "java.configuration.updateBuildConfiguration": "interactive"
+}

+ 2 - 2
android/app/build.gradle

@@ -140,8 +140,8 @@ android {
         applicationId 'com.clicknpush.mobile'
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
-        versionCode 29
-        versionName "0.1.9"
+        versionCode 32
+        versionName "0.1.10"
     }
     splits {
         abi {

+ 5 - 4
android/app/src/main/AndroidManifest.xml

@@ -1,4 +1,4 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.clicknpush.mobile">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.clicknpush.mobile">
   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.CAMERA"/>
@@ -8,13 +8,14 @@
   <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
   <uses-permission android:name="android.permission.VIBRATE"/>
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+  <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
   <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
-    <meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyDe8GipzvTwaqnHQrzH-b795qucDVPuZgU"/>
+    <meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyDPN1Z8SV7WClUdnoVyTQMoUfMYeC0DZyU"/>
     <meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
-    <meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="43.0.0"/>
     <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
     <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
-    <meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@cdmoss/cnp-mobile"/>
+    <meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/082de7a5-d9b8-4c96-bd1b-5706cca20324"/>
+    <meta-data android:name="expo.modules.updates.EXPO_RUNTIME_VERSION" android:value="1.0.0"/>
     <activity android:name=".MainActivity" android:exported="true" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
       <intent-filter>
         <action android:name="android.intent.action.MAIN"/>

+ 5 - 5
android/build.gradle

@@ -2,11 +2,11 @@
 
 buildscript {
     ext {
-        buildToolsVersion = "29.0.3"
-        minSdkVersion = 21
+        buildToolsVersion = "30.0.3"
+        minSdkVersion = 29
         compileSdkVersion = 33
-        targetSdkVersion = 32
-        kotlinVersion = "1.6.0"
+        targetSdkVersion = 33
+        kotlinVersion = "1.6.10"
     }
     repositories {
         google()
@@ -39,4 +39,4 @@ allprojects {
         jcenter()
         maven { url 'https://www.jitpack.io' }
     }
-}
+}

+ 3 - 1
android/gradle.properties

@@ -38,4 +38,6 @@ expo.gif.enabled=true
 expo.webp.enabled=true
 # Enable animated webp support (~3.4 MB increase)
 # Disabled by default because iOS doesn't support animated webp
-expo.webp.animated=false
+expo.webp.animated=false
+
+android.kotlinVersion=1.6.10

+ 7 - 5
app.json

@@ -15,7 +15,8 @@
       "backgroundColor": "#ffffff"
     },
     "updates": {
-      "fallbackToCacheTimeout": 0
+      "fallbackToCacheTimeout": 0,
+      "url": "https://u.expo.dev/082de7a5-d9b8-4c96-bd1b-5706cca20324"
     },
     "assetBundlePatterns": [
       "**/*"
@@ -23,7 +24,7 @@
     "ios": {
       "bundleIdentifier": "com.clicknpush.app",
       "googleServicesFile": "./GoogleService-Info.plist",
-      "buildNumber": "0.0.18"
+      "buildNumber": "0.1.10"
     },
     "android": {
       "googleServicesFile": "./google-services.json",
@@ -32,15 +33,16 @@
         "backgroundImage": "./assets/cover.png"
       },
       "package": "com.clicknpush.mobile",
-      "versionCode": 20,
+      "versionCode": 32,
       "config": {
         "googleMaps": {
-          "apiKey": "AIzaSyBkpMWgPFbmVFUrma67bR8knwqA-U24H8c"
+          "apiKey": "AIzaSyDPN1Z8SV7WClUdnoVyTQMoUfMYeC0DZyU"
         }
       }
     },
     "web": {
       "favicon": "./assets/favicon.png"
-    }
+    },
+    "runtimeVersion": "1.0.0"
   }
 }

+ 27 - 0
eas.json

@@ -0,0 +1,27 @@
+{
+  "cli": {
+    "version": ">= 0.60.0"
+  },
+  "build": {
+    "development": {
+      "distribution": "internal",
+      "android": {
+        "gradleCommand": ":app:assembleDebug"
+      },
+      "ios": {
+        "buildConfiguration": "Debug"
+      }
+    },
+    "preview": {
+      "distribution": "internal"
+    },
+    "production": {
+      "android": {
+        "image": "latest"
+      }
+    }
+  },
+  "submit": {
+    "production": {}
+  }
+}

+ 3 - 3
ios/cnpmobile/Supporting/Expo.plist

@@ -8,9 +8,9 @@
     <true/>
     <key>EXUpdatesLaunchWaitMs</key>
     <integer>0</integer>
-    <key>EXUpdatesSDKVersion</key>
-    <string>43.0.0</string>
     <key>EXUpdatesURL</key>
-    <string>https://exp.host/@cdmoss/cnp-mobile</string>
+    <string>https://u.expo.dev/082de7a5-d9b8-4c96-bd1b-5706cca20324</string>
+    <key>EXUpdatesRuntimeVersion</key>
+    <string>1.0.0</string>
   </dict>
 </plist>

File diff suppressed because it is too large
+ 284 - 621
package-lock.json


+ 1 - 1
package.json

@@ -46,7 +46,7 @@
     "expo-app-loading": "~1.2.1",
     "expo-asset": "~8.4.3",
     "expo-auth-session": "~3.4.2",
-    "expo-cli": "^4.13.0",
+    "expo-cli": "^6.0.5",
     "expo-constants": "~12.1.3",
     "expo-file-system": "~13.0.3",
     "expo-font": "~10.0.3",

+ 26 - 1
src/components/Map/Panels/LandmarkDetailsPanel/DetailsBody.tsx

@@ -8,17 +8,21 @@
 import { FontAwesome } from "@expo/vector-icons";
 import { useNavigationState } from "@react-navigation/native";
 import React, { MutableRefObject, useEffect, useRef, useState } from "react";
-import { FlatList, Image, ScrollView, StyleSheet, Text, TextInput, View } from "react-native";
+import { FlatList, Dimensions, Image, ScrollView, StyleSheet, Text, TextInput, View } from "react-native";
+import { TouchableOpacity } from "react-native-gesture-handler";
 import Picker from "react-native-picker-select";
 import { QueryStatus } from "react-query";
 import { LMComment } from "../../../../data/comments";
 import { Landmark, LMPhoto } from "../../../../data/landmarks";
+import MapView, {Marker} from "react-native-maps";
+import { usePermissions } from "../../../../data/PermissionsContext";
 import { MainTabsNavigationProp } from "../../../../navigation/MainTabsNavigator";
 import { lmTypes as allLmTypes, lmTypesIndoor } from "../../../../utils/GlobalUtils";
 import LandmarkTypePicker from "../../../LandmarkTypePicker";
 import { Separator } from "../../../Separator";
 import { CommentsContainer } from "./CommentsContainer";
 import { LandmarkPhotos } from "./LandmarkPhotos";
+import { useOutdoorMapState } from "../../MainMapComponent/useMapState";
 
 
 
@@ -58,6 +62,8 @@ interface DetailsBodyProps {
  * Component that renders the body of the Landmark details panel
 */
 export const DetailsBody: React.FC<DetailsBodyProps> = (props) => {
+    const {locationPermissionsGranted, checkLocationPermissions, voicePermissionsGranted, checkVoicePermissions} = usePermissions();
+    const mapState = useOutdoorMapState()
 
     const navigationState = useNavigationState(state => state)
     const [currentRoute, setCurrentRoute] = useState<string>()
@@ -133,6 +139,24 @@ export const DetailsBody: React.FC<DetailsBodyProps> = (props) => {
         <ScrollView ref={mainScrollRef} nestedScrollEnabled={true} contentContainerStyle={{justifyContent: 'space-between'}} style={{flex: 1, marginHorizontal: 20}}>
             {props.editingEnabled ?
             <>
+                <Text style={{color: 'white', marginBottom: 10}}>Location</Text>
+                <MapView
+                    toolbarEnabled={false}
+                    onPress={(e) => 
+                        props.setUpdatedLandmark({...props.updatedLandmark, longitude: e.nativeEvent.coordinate.longitude, latitude: e.nativeEvent.coordinate.latitude})
+                    }
+                    testID="mapViewLocationEdit"
+                    style={{ width: '100%', height: Dimensions.get("window").height * .4, marginBottom: 20}}
+                    initialRegion={{latitude: props.landmark?.latitude, longitude: props.landmark?.longitude, latitudeDelta: 0.01, longitudeDelta: 0.01}}
+                    showsUserLocation={locationPermissionsGranted}
+                    showsMyLocationButton={false}
+                    >
+
+                    <Marker
+                        coordinate={{ latitude: props.updatedLandmark?.latitude as number, longitude: props.updatedLandmark?.longitude as number }} >
+                        {props.updatedLandmark?.landmark_type ? <Image style={{ height: 35, width: 25 }} source={lmTypes[props.updatedLandmark?.landmark_type]?.image} /> : null}
+                    </Marker>
+                </MapView>
                 <LandmarkTypePickerContainer />
                 <Separator style={{marginBottom: 20, opacity: .5}} color="lightgray" />
                 <Text style={{color: 'white', marginBottom: 10}}>Description</Text>
@@ -143,6 +167,7 @@ export const DetailsBody: React.FC<DetailsBodyProps> = (props) => {
                         onChangeText={text => props.setUpdatedLandmark({...props.updatedLandmark, description: text})} 
                         value={props.updatedLandmark?.description}/>
                 </ScrollView>
+
             </>: <EditingDisabledUpperView />}
             {!props.editingEnabled ?
             <CommentsContainer

+ 1 - 1
src/components/Map/Panels/LandmarkDetailsPanel/LandmarkDetails.tsx

@@ -330,7 +330,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({markerWindowPosition,
         if (selectedImage > -1) 
             return Dimensions.get("window").height 
         else if (keyboardOpened || editingEnabled || (!landmarkOwnedByUser(landmarkQuery?.data?.landmark) && landmarkQuery?.data?.landmark?.photos?.length == 0)) {
-            return Dimensions.get("window").height * .4
+            return Dimensions.get("window").height * .8
         }
         else if (landmarkQuery?.data?.landmark?.photos?.length > 0) 
             return Dimensions.get("window").height * .9 

File diff suppressed because it is too large
+ 319 - 320
yarn.lock


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