Skip to content

Commit b68f4de

Browse files
authored
Merge pull request #33 from TheLukaszNs/develop
Get thumbnails for categories and sites from Firebase Hosting
2 parents 0ec5adb + 277d3eb commit b68f4de

File tree

8 files changed

+220
-42
lines changed

8 files changed

+220
-42
lines changed

android/app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ android {
129129

130130
dependencies {
131131
compile project(':react-native-vector-icons')
132+
compile project(':react-native-fetch-blob')
132133
compile fileTree(dir: "libs", include: ["*.jar"])
133134
compile "com.android.support:appcompat-v7:23.0.1"
134135
compile "com.facebook.react:react-native:+" // From node_modules
@@ -141,6 +142,7 @@ dependencies {
141142
compile "com.google.firebase:firebase-analytics:11.0.0"
142143
compile "com.google.firebase:firebase-perf:11.0.0"
143144
compile "com.google.firebase:firebase-database:11.0.0"
145+
compile "com.google.firebase:firebase-storage:11.0.0"
144146

145147
// If you are receiving Google Play API availability issues, add the following dependency
146148
// compile "com.google.android.gms:play-services-base:11.0.0"

android/app/src/main/java/org/gdgsrilanka/codelanka/eznet/MainApplication.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import io.invertase.firebase.crash.RNFirebaseCrashPackage;
1919
import io.invertase.firebase.perf.RNFirebasePerformancePackage;
2020
import io.invertase.firebase.database.RNFirebaseDatabasePackage;
21+
import io.invertase.firebase.storage.RNFirebaseStoragePackage;
22+
23+
import com.RNFetchBlob.RNFetchBlobPackage;
2124

2225
import com.google.firebase.database.FirebaseDatabase;
2326

@@ -38,6 +41,8 @@ protected List<ReactPackage> getPackages() {
3841
new RNFirebaseCrashPackage(),
3942
new RNFirebasePerformancePackage(),
4043
new RNFirebaseDatabasePackage(),
44+
new RNFirebaseStoragePackage(),
45+
new RNFetchBlobPackage(),
4146
new VectorIconsPackage()
4247
);
4348
}

android/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
rootProject.name = 'EZNet'
2+
include ':react-native-fetch-blob'
3+
project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android')
24
include ':react-native-vector-icons'
35
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
46
include ':react-native-firebase'

ios/EZNet.xcodeproj/project.pbxproj

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
8EB94ED2666648F3ACD427C1 /* rubicon-icon-font.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2F9381A263934921AA18C788 /* rubicon-icon-font.ttf */; };
4848
EFC080D9C57740B9BE42CFA6 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FDD3CCE7476B4FCBB6E40BE9 /* SimpleLineIcons.ttf */; };
4949
E36E03D4C0614347BD1FF529 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C5F2973332314F3090CE044D /* Zocial.ttf */; };
50+
F90355EC5AE4488D8AC3A076 /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F2D9265AA354DE6B759F93A /* libRNFetchBlob.a */; };
51+
0FCD125FCBB04C22BBC14E4F /* libRNFirebase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C82810B0F72E44CFBF184C10 /* libRNFirebase.a */; };
5052
/* End PBXBuildFile section */
5153

5254
/* Begin PBXContainerItemProxy section */
@@ -278,6 +280,10 @@
278280
2F9381A263934921AA18C788 /* rubicon-icon-font.ttf */ = {isa = PBXFileReference; name = "rubicon-icon-font.ttf"; path = "../node_modules/native-base/Fonts/rubicon-icon-font.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
279281
FDD3CCE7476B4FCBB6E40BE9 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; name = "SimpleLineIcons.ttf"; path = "../node_modules/native-base/Fonts/SimpleLineIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
280282
C5F2973332314F3090CE044D /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/native-base/Fonts/Zocial.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
283+
A8C244E03280488FA985513C /* RNFetchBlob.xcodeproj */ = {isa = PBXFileReference; name = "RNFetchBlob.xcodeproj"; path = "../node_modules/react-native-fetch-blob/ios/RNFetchBlob.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
284+
0F2D9265AA354DE6B759F93A /* libRNFetchBlob.a */ = {isa = PBXFileReference; name = "libRNFetchBlob.a"; path = "libRNFetchBlob.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
285+
B6BA648C8AF7429A99A5114F /* RNFirebase.xcodeproj */ = {isa = PBXFileReference; name = "RNFirebase.xcodeproj"; path = "../node_modules/react-native-firebase/ios/RNFirebase.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
286+
C82810B0F72E44CFBF184C10 /* libRNFirebase.a */ = {isa = PBXFileReference; name = "libRNFirebase.a"; path = "libRNFirebase.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
281287
/* End PBXFileReference section */
282288

283289
/* Begin PBXFrameworksBuildPhase section */
@@ -304,6 +310,8 @@
304310
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
305311
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
306312
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
313+
F90355EC5AE4488D8AC3A076 /* libRNFetchBlob.a in Frameworks */,
314+
0FCD125FCBB04C22BBC14E4F /* libRNFirebase.a in Frameworks */,
307315
);
308316
runOnlyForDeploymentPostprocessing = 0;
309317
};
@@ -470,6 +478,8 @@
470478
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
471479
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
472480
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
481+
A8C244E03280488FA985513C /* RNFetchBlob.xcodeproj */,
482+
B6BA648C8AF7429A99A5114F /* RNFirebase.xcodeproj */,
473483
);
474484
name = Libraries;
475485
sourceTree = "<group>";
@@ -1028,6 +1038,16 @@
10281038
);
10291039
PRODUCT_NAME = "$(TARGET_NAME)";
10301040
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EZNet.app/EZNet";
1041+
LIBRARY_SEARCH_PATHS = (
1042+
"$(inherited)",
1043+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1044+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1045+
);
1046+
HEADER_SEARCH_PATHS = (
1047+
"$(inherited)",
1048+
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**",
1049+
"$(SRCROOT)\..\node_modules\react-native-firebase\ios\RNFirebase/**",
1050+
);
10311051
};
10321052
name = Debug;
10331053
};
@@ -1045,6 +1065,16 @@
10451065
);
10461066
PRODUCT_NAME = "$(TARGET_NAME)";
10471067
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EZNet.app/EZNet";
1068+
LIBRARY_SEARCH_PATHS = (
1069+
"$(inherited)",
1070+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1071+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1072+
);
1073+
HEADER_SEARCH_PATHS = (
1074+
"$(inherited)",
1075+
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**",
1076+
"$(SRCROOT)\..\node_modules\react-native-firebase\ios\RNFirebase/**",
1077+
);
10481078
};
10491079
name = Release;
10501080
};
@@ -1063,6 +1093,11 @@
10631093
);
10641094
PRODUCT_NAME = EZNet;
10651095
VERSIONING_SYSTEM = "apple-generic";
1096+
HEADER_SEARCH_PATHS = (
1097+
"$(inherited)",
1098+
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**",
1099+
"$(SRCROOT)\..\node_modules\react-native-firebase\ios\RNFirebase/**",
1100+
);
10661101
};
10671102
name = Debug;
10681103
};
@@ -1080,6 +1115,11 @@
10801115
);
10811116
PRODUCT_NAME = EZNet;
10821117
VERSIONING_SYSTEM = "apple-generic";
1118+
HEADER_SEARCH_PATHS = (
1119+
"$(inherited)",
1120+
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**",
1121+
"$(SRCROOT)\..\node_modules\react-native-firebase\ios\RNFirebase/**",
1122+
);
10831123
};
10841124
name = Release;
10851125
};
@@ -1106,6 +1146,16 @@
11061146
SDKROOT = appletvos;
11071147
TARGETED_DEVICE_FAMILY = 3;
11081148
TVOS_DEPLOYMENT_TARGET = 9.2;
1149+
LIBRARY_SEARCH_PATHS = (
1150+
"$(inherited)",
1151+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1152+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1153+
);
1154+
HEADER_SEARCH_PATHS = (
1155+
"$(inherited)",
1156+
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**",
1157+
"$(SRCROOT)\..\node_modules\react-native-firebase\ios\RNFirebase/**",
1158+
);
11091159
};
11101160
name = Debug;
11111161
};
@@ -1132,6 +1182,16 @@
11321182
SDKROOT = appletvos;
11331183
TARGETED_DEVICE_FAMILY = 3;
11341184
TVOS_DEPLOYMENT_TARGET = 9.2;
1185+
LIBRARY_SEARCH_PATHS = (
1186+
"$(inherited)",
1187+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1188+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1189+
);
1190+
HEADER_SEARCH_PATHS = (
1191+
"$(inherited)",
1192+
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**",
1193+
"$(SRCROOT)\..\node_modules\react-native-firebase\ios\RNFirebase/**",
1194+
);
11351195
};
11361196
name = Release;
11371197
};
@@ -1153,6 +1213,11 @@
11531213
SDKROOT = appletvos;
11541214
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EZNet-tvOS.app/EZNet-tvOS";
11551215
TVOS_DEPLOYMENT_TARGET = 10.1;
1216+
LIBRARY_SEARCH_PATHS = (
1217+
"$(inherited)",
1218+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1219+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1220+
);
11561221
};
11571222
name = Debug;
11581223
};
@@ -1174,6 +1239,11 @@
11741239
SDKROOT = appletvos;
11751240
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EZNet-tvOS.app/EZNet-tvOS";
11761241
TVOS_DEPLOYMENT_TARGET = 10.1;
1242+
LIBRARY_SEARCH_PATHS = (
1243+
"$(inherited)",
1244+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1245+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1246+
);
11771247
};
11781248
name = Release;
11791249
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"react-burger-menu": "^2.1.3",
1414
"react-burger-nav": "^2.0.2",
1515
"react-native": "0.45.1",
16+
"react-native-fetch-blob": "^0.10.8",
1617
"react-native-firebase": "^2.0.2",
1718
"react-native-material-ui": "^1.12.0",
1819
"react-native-responsive-image": "^2.1.0",

src/actions/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { FETCH_DATA } from './types';
33
import Api from '../api/Api';
44

55
export const actionFetchData = () => (dispatch) => {
6-
Api.getCombinedData(Api.getCategories, Api.getSites)
7-
.then(data => dispatch({
8-
type: FETCH_DATA,
9-
payload: data,
10-
}));
6+
Api.getCombinedData(Api.getCategories, Api.getSites, Api.getThumbnail)
7+
.then((data) => {
8+
dispatch({
9+
type: FETCH_DATA,
10+
payload: data,
11+
});
12+
});
1113
};

0 commit comments

Comments
 (0)