Skip to content

Commit

Permalink
Merge pull request #47 from developmentseed/update-react-native-0.58
Browse files Browse the repository at this point in the history
update react, react-native, & react-native-mapbox-gl, fix const bug, remove unused file
  • Loading branch information
sethvincent committed Jun 13, 2019
2 parents 742ae3c + 08f5ee9 commit 5b95131
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 634 deletions.
8 changes: 2 additions & 6 deletions app/components/AuthorizationManager.js
Expand Up @@ -6,18 +6,14 @@ import { isAuthorized as checkAuthorization } from '../services/auth'

class AuthorizationManager extends PureComponent {
async componentDidMount () {
const { setAuthorized } = this.props

setAuthorized(await checkAuthorization())
this.props.setAuthorized(await checkAuthorization())
}

async componentDidUpdate ({ isAuthorized: wasAuthorized }) {
const { setAuthorized } = this.props

const isAuthorized = await checkAuthorization()

if (wasAuthorized !== isAuthorized) {
setAuthorized(isAuthorized)
this.props.setAuthorized(isAuthorized)
}
}

Expand Down
15 changes: 4 additions & 11 deletions app/screens/Explore.js
Expand Up @@ -102,8 +102,6 @@ class Explore extends React.Component {
}

onDidFinishRenderingMapFully = async () => {
const { updateVisibleBounds } = this.props

this.setState({
isMapLoaded: true,
clickableLayers: ['editedPois', 'pois', 'editedPolygons', 'buildings', 'roads', 'roadsLower', 'railwayLine', 'waterLine', 'leisure'],
Expand All @@ -113,7 +111,7 @@ class Explore extends React.Component {
const visibleBounds = await this.mapRef.getVisibleBounds()
const zoomLevel = await this.mapRef.getZoom()

updateVisibleBounds(visibleBounds, zoomLevel)
this.props.updateVisibleBounds(visibleBounds, zoomLevel)
}

onWillFocus = payload => {
Expand Down Expand Up @@ -149,10 +147,8 @@ class Explore extends React.Component {
}

onRegionIsChanging = async evt => {
const { updateVisibleBounds } = this.props

// update the redux state with the bbox
updateVisibleBounds(await this.mapRef.getVisibleBounds(), await this.mapRef.getZoom())
this.props.updateVisibleBounds(await this.mapRef.getVisibleBounds(), await this.mapRef.getZoom())
}

_fetchData (visibleBounds, zoomLevel) {
Expand All @@ -165,10 +161,8 @@ class Explore extends React.Component {
}

onRegionDidChange = evt => {
const { updateVisibleBounds } = this.props
const { properties: { visibleBounds, zoomLevel } } = evt

updateVisibleBounds(visibleBounds, zoomLevel)
this.props.updateVisibleBounds(visibleBounds, zoomLevel)
}

onPress = e => {
Expand All @@ -195,10 +189,9 @@ class Explore extends React.Component {
}

async loadFeaturesAtPoint (rect) {
const { setSelectedFeatures } = this.props
try {
const { features } = await this.mapRef.queryRenderedFeaturesInRect(rect, null, this.state.clickableLayers)
setSelectedFeatures(features)
this.props.setSelectedFeatures(features)
} catch (err) {
console.log('failed getting features', err)
}
Expand Down
3 changes: 0 additions & 3 deletions config/index.js

This file was deleted.

30 changes: 22 additions & 8 deletions ios/Observe.xcodeproj/project.pbxproj
Expand Up @@ -26,9 +26,8 @@
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
264528A6223AB43A0027F56B /* Collecticons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 264528A5223AB43A0027F56B /* Collecticons.ttf */; };
266358F52208E32F008C2B62 /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 266358C72208E32F008C2B62 /* Mapbox.framework */; };
266358F62208E32F008C2B62 /* Mapbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 266358C72208E32F008C2B62 /* Mapbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
266358FE2208E39B008C2B62 /* libRCTMGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 266358FD2208E369008C2B62 /* libRCTMGL.a */; };
26F1AB5D22B1CD0B003540FB /* Mapbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 26F1AB5C22B1CD0B003540FB /* Mapbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
26F1AB5E22B1CD6E003540FB /* libRCTMGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 266358FD2208E369008C2B62 /* libRCTMGL.a */; };
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
Expand Down Expand Up @@ -212,6 +211,13 @@
remoteGlobalIDString = 440C7688674D8DBC75F88B6F03F37F54;
remoteInfo = "Pods-ObserveTests";
};
26F1AB5822B1CCDA003540FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 623ED83ECC984C7DB624A2EE /* RNGestureHandler.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = B5C32A36220C603B000FFB8D;
remoteInfo = "RNGestureHandler-tvOS";
};
2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
Expand Down Expand Up @@ -424,7 +430,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
266358F62208E32F008C2B62 /* Mapbox.framework in Embed Frameworks */,
26F1AB5D22B1CD0B003540FB /* Mapbox.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -455,9 +461,9 @@
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
2620ACB62214EBF000ED09FD /* Observe.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Observe.entitlements; path = Observe/Observe.entitlements; sourceTree = "<group>"; };
264528A5223AB43A0027F56B /* Collecticons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Collecticons.ttf; path = Observe/Collecticons.ttf; sourceTree = "<group>"; };
266358C72208E32F008C2B62 /* Mapbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Mapbox.framework; sourceTree = "<group>"; };
266358F82208E369008C2B62 /* RCTMGL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTMGL.xcodeproj; path = "../node_modules/@mapbox/react-native-mapbox-gl/ios/RCTMGL.xcodeproj"; sourceTree = "<group>"; };
26DAE23C227CAF5C00DFF1AB /* Pods.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pods.xcodeproj; path = Pods/Pods.xcodeproj; sourceTree = "<group>"; };
26F1AB5C22B1CD0B003540FB /* Mapbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Mapbox.framework; path = "../node_modules/@mapbox/react-native-mapbox-gl/ios/Mapbox.framework"; sourceTree = "<group>"; };
27E9609866E8413ABCC705D8 /* RNCookieManagerIOS.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCookieManagerIOS.xcodeproj; path = "../node_modules/react-native-cookies/ios/RNCookieManagerIOS.xcodeproj"; sourceTree = "<group>"; };
2CFFFAA40BEA49BB93C1A784 /* libRNCookieManagerIOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCookieManagerIOS.a; sourceTree = "<group>"; };
2D02E47B1E0B4A5D006451C7 /* Observe-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Observe-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -508,18 +514,17 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
26F1AB5E22B1CD6E003540FB /* libRCTMGL.a in Frameworks */,
5D12BD202245942F00F9BC6E /* libRNFetchBlob.a in Frameworks */,
5D14C0F52239E93500C8981E /* Foundation.framework in Frameworks */,
5D6A24BE22382E2500AF7118 /* libRNKeychain.a in Frameworks */,
266358FE2208E39B008C2B62 /* libRCTMGL.a in Frameworks */,
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */,
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */,
11D1A2F320CAFA9E000508D9 /* libRCTAnimation.a in Frameworks */,
146834051AC3E58100842450 /* libReact.a in Frameworks */,
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
266358F52208E32F008C2B62 /* Mapbox.framework in Frameworks */,
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
Expand Down Expand Up @@ -717,6 +722,7 @@
isa = PBXGroup;
children = (
266359382208FA43008C2B62 /* libRNGestureHandler.a */,
26F1AB5922B1CCDA003540FB /* libRNGestureHandler-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -839,9 +845,9 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
26F1AB5C22B1CD0B003540FB /* Mapbox.framework */,
264528A5223AB43A0027F56B /* Collecticons.ttf */,
8A9F59F52289529C002CDA8F /* Monospace.ttf */,
266358C72208E32F008C2B62 /* Mapbox.framework */,
13B07FAE1A68108700A75B9A /* Observe */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* ObserveTests */,
Expand Down Expand Up @@ -995,6 +1001,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -1230,6 +1237,13 @@
remoteRef = 26DAE246227CAF5C00DFF1AB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
26F1AB5922B1CCDA003540FB /* libRNGestureHandler-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRNGestureHandler-tvOS.a";
remoteRef = 26F1AB5822B1CCDA003540FB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -15,7 +15,7 @@
"version": "./version-ios.sh"
},
"dependencies": {
"@mapbox/react-native-mapbox-gl": "github:developmentseed/react-native-mapbox-gl",
"@mapbox/react-native-mapbox-gl": "developmentseed/react-native-mapbox-gl",
"@mapbox/tile-cover": "^3.0.2",
"@mapbox/tilebelt": "^1.0.1",
"@turf/area": "^6.0.1",
Expand Down Expand Up @@ -50,8 +50,8 @@
"p-retry": "^4.0.0",
"p-timeout": "^3.0.0",
"pretty-bytes": "^5.1.0",
"react": "16.6.3",
"react-native": "0.58.3",
"react": "16.8.6",
"react-native": "0.58.6",
"react-native-config": "^0.11.7",
"react-native-cookies": "github:developmentseed/react-native-cookies",
"react-native-datepicker": "^1.7.2",
Expand Down

0 comments on commit 5b95131

Please sign in to comment.