Skip to content

Commit 5d0c8b4

Browse files
committed
Add Review & Fix Some Issues
1 parent 76272b2 commit 5d0c8b4

File tree

13 files changed

+204
-13
lines changed

13 files changed

+204
-13
lines changed

App.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { onError } from 'apollo-link-error';
66
import { ApolloLink } from 'apollo-link';
77
import { setContext } from "apollo-link-context";
88
import { ApolloProvider } from 'react-apollo';
9-
import Home from './src/screens/home';
9+
import AppRoute from './routes';
1010

1111
const authLink = setContext((_, { headers }) => {
1212
const token = "xVy99wBbL08Z4lgyaB4_SRR04EPfRK2CKtCKAE_F47vZDaUtJnlVmxmYPxR2cfRIVuLkwQyjZInDWuFNSCNvXeF4iTcveMPugsJsDAeZRO6GCDla-t7ujHTuv77uXHYx";
@@ -37,13 +37,12 @@ const client = new ApolloClient({
3737
cache: new InMemoryCache()
3838
});
3939

40+
4041
export default class App extends Component {
4142
render() {
42-
43-
console.log("process", JSON.stringify(process.env))
4443
return (
4544
<ApolloProvider client={client}>
46-
<Home />
45+
<AppRoute />
4746
</ApolloProvider>
4847
);
4948
}

android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ android {
138138
}
139139

140140
dependencies {
141+
implementation project(':react-native-gesture-handler')
141142
implementation fileTree(dir: "libs", include: ["*.jar"])
142143
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
143144
implementation "com.facebook.react:react-native:+" // From node_modules

android/app/src/main/java/com/yelpgraphql/MainApplication.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Application;
44

55
import com.facebook.react.ReactApplication;
6+
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
67
import com.facebook.react.ReactNativeHost;
78
import com.facebook.react.ReactPackage;
89
import com.facebook.react.shell.MainReactPackage;
@@ -22,7 +23,8 @@ public boolean getUseDeveloperSupport() {
2223
@Override
2324
protected List<ReactPackage> getPackages() {
2425
return Arrays.<ReactPackage>asList(
25-
new MainReactPackage()
26+
new MainReactPackage(),
27+
new RNGestureHandlerPackage()
2628
);
2729
}
2830

android/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
rootProject.name = 'YelpGraphql'
2+
include ':react-native-gesture-handler'
3+
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
24

35
include ':app'

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {AppRegistry} from 'react-native';
1+
import { AppRegistry } from 'react-native';
22
import App from './App';
3-
import {name as appName} from './app.json';
3+
import { name as appName } from './app.json';
44

55
AppRegistry.registerComponent(appName, () => App);

ios/YelpGraphql.xcodeproj/project.pbxproj

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
};
66
objectVersion = 46;
77
objects = {
8-
98
/* Begin PBXBuildFile section */
109
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
1110
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
@@ -40,6 +39,8 @@
4039
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
4140
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
4241
ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; };
42+
AFA2263ED0EA4F49974B776E /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBF206FDC3F642B3A41DC514 /* libRNGestureHandler.a */; };
43+
9045AB92574B463A953F6C16 /* libRNGestureHandler-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BF66F65DD7E2411A9BF3AFA1 /* libRNGestureHandler-tvOS.a */; };
4344
/* End PBXBuildFile section */
4445

4546
/* Begin PBXContainerItemProxy section */
@@ -347,6 +348,9 @@
347348
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
348349
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
349350
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
351+
5A35FADEA57B4FB98283FFCE /* RNGestureHandler.xcodeproj */ = {isa = PBXFileReference; name = "RNGestureHandler.xcodeproj"; path = "../node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
352+
DBF206FDC3F642B3A41DC514 /* libRNGestureHandler.a */ = {isa = PBXFileReference; name = "libRNGestureHandler.a"; path = "libRNGestureHandler.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
353+
BF66F65DD7E2411A9BF3AFA1 /* libRNGestureHandler-tvOS.a */ = {isa = PBXFileReference; name = "libRNGestureHandler-tvOS.a"; path = "libRNGestureHandler-tvOS.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
350354
/* End PBXFileReference section */
351355

352356
/* Begin PBXFrameworksBuildPhase section */
@@ -375,6 +379,7 @@
375379
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
376380
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
377381
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
382+
AFA2263ED0EA4F49974B776E /* libRNGestureHandler.a in Frameworks */,
378383
);
379384
runOnlyForDeploymentPostprocessing = 0;
380385
};
@@ -391,6 +396,7 @@
391396
2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */,
392397
2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,
393398
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,
399+
9045AB92574B463A953F6C16 /* libRNGestureHandler-tvOS.a in Frameworks */,
394400
);
395401
runOnlyForDeploymentPostprocessing = 0;
396402
};
@@ -564,6 +570,7 @@
564570
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
565571
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
566572
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
573+
5A35FADEA57B4FB98283FFCE /* RNGestureHandler.xcodeproj */,
567574
);
568575
name = Libraries;
569576
sourceTree = "<group>";
@@ -692,7 +699,7 @@
692699
83CBB9F71A601CBA00E9B192 /* Project object */ = {
693700
isa = PBXProject;
694701
attributes = {
695-
LastUpgradeCheck = 0940;
702+
LastUpgradeCheck = 940;
696703
ORGANIZATIONNAME = Facebook;
697704
TargetAttributes = {
698705
00E356ED1AD99517003FC87E = {
@@ -1189,6 +1196,15 @@
11891196
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
11901197
PRODUCT_NAME = "$(TARGET_NAME)";
11911198
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YelpGraphql.app/YelpGraphql";
1199+
LIBRARY_SEARCH_PATHS = (
1200+
"$(inherited)",
1201+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1202+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1203+
);
1204+
HEADER_SEARCH_PATHS = (
1205+
"$(inherited)",
1206+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1207+
);
11921208
};
11931209
name = Debug;
11941210
};
@@ -1207,6 +1223,15 @@
12071223
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
12081224
PRODUCT_NAME = "$(TARGET_NAME)";
12091225
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YelpGraphql.app/YelpGraphql";
1226+
LIBRARY_SEARCH_PATHS = (
1227+
"$(inherited)",
1228+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1229+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1230+
);
1231+
HEADER_SEARCH_PATHS = (
1232+
"$(inherited)",
1233+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1234+
);
12101235
};
12111236
name = Release;
12121237
};
@@ -1226,6 +1251,10 @@
12261251
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
12271252
PRODUCT_NAME = YelpGraphql;
12281253
VERSIONING_SYSTEM = "apple-generic";
1254+
HEADER_SEARCH_PATHS = (
1255+
"$(inherited)",
1256+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1257+
);
12291258
};
12301259
name = Debug;
12311260
};
@@ -1244,6 +1273,10 @@
12441273
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
12451274
PRODUCT_NAME = YelpGraphql;
12461275
VERSIONING_SYSTEM = "apple-generic";
1276+
HEADER_SEARCH_PATHS = (
1277+
"$(inherited)",
1278+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1279+
);
12471280
};
12481281
name = Release;
12491282
};
@@ -1270,6 +1303,15 @@
12701303
SDKROOT = appletvos;
12711304
TARGETED_DEVICE_FAMILY = 3;
12721305
TVOS_DEPLOYMENT_TARGET = 9.2;
1306+
LIBRARY_SEARCH_PATHS = (
1307+
"$(inherited)",
1308+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1309+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1310+
);
1311+
HEADER_SEARCH_PATHS = (
1312+
"$(inherited)",
1313+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1314+
);
12731315
};
12741316
name = Debug;
12751317
};
@@ -1296,6 +1338,15 @@
12961338
SDKROOT = appletvos;
12971339
TARGETED_DEVICE_FAMILY = 3;
12981340
TVOS_DEPLOYMENT_TARGET = 9.2;
1341+
LIBRARY_SEARCH_PATHS = (
1342+
"$(inherited)",
1343+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1344+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1345+
);
1346+
HEADER_SEARCH_PATHS = (
1347+
"$(inherited)",
1348+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1349+
);
12991350
};
13001351
name = Release;
13011352
};
@@ -1321,6 +1372,15 @@
13211372
SDKROOT = appletvos;
13221373
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YelpGraphql-tvOS.app/YelpGraphql-tvOS";
13231374
TVOS_DEPLOYMENT_TARGET = 10.1;
1375+
LIBRARY_SEARCH_PATHS = (
1376+
"$(inherited)",
1377+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1378+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1379+
);
1380+
HEADER_SEARCH_PATHS = (
1381+
"$(inherited)",
1382+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1383+
);
13241384
};
13251385
name = Debug;
13261386
};
@@ -1346,6 +1406,15 @@
13461406
SDKROOT = appletvos;
13471407
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YelpGraphql-tvOS.app/YelpGraphql-tvOS";
13481408
TVOS_DEPLOYMENT_TARGET = 10.1;
1409+
LIBRARY_SEARCH_PATHS = (
1410+
"$(inherited)",
1411+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1412+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1413+
);
1414+
HEADER_SEARCH_PATHS = (
1415+
"$(inherited)",
1416+
"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
1417+
);
13491418
};
13501419
name = Release;
13511420
};

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"react": "16.8.3",
2020
"react-apollo": "^2.5.6",
2121
"react-native": "0.59.8",
22+
"react-native-gesture-handler": "^1.2.2",
2223
"react-navigation": "^3.11.0"
2324
},
2425
"devDependencies": {

routes.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { createStackNavigator, createAppContainer } from "react-navigation";
2+
import Home from "./src/screens/home";
3+
import Review from "./src/screens/review";
4+
5+
const AppNavigator = createStackNavigator({
6+
Home: {
7+
screen: Home,
8+
navigationOptions: {
9+
title: "Yelp Graphql",
10+
}
11+
},
12+
Review: {
13+
screen: Review,
14+
navigationOptions: {
15+
title: "Reviews",
16+
}
17+
},
18+
}, {
19+
initialRouteName: 'Home',
20+
});
21+
22+
export default createAppContainer(AppNavigator);

src/graphql/queries.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const EXAMPLE = gql`
55
search(term: $term, location: $location) {
66
total
77
business {
8+
id
89
name
910
rating
1011
review_count
@@ -14,4 +15,15 @@ export const EXAMPLE = gql`
1415
}
1516
}
1617
}
18+
`;
19+
20+
export const GET_REVIEWS = gql`
21+
query Reviews($business:String!){
22+
reviews(business: $business) {
23+
review {
24+
text
25+
}
26+
total
27+
}
28+
}
1729
`;

0 commit comments

Comments
 (0)