diff --git a/android/app/build.gradle b/android/app/build.gradle
index cd0b6c0..2f5b9f6 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -127,6 +127,8 @@ android {
}
dependencies {
+ compile project(':react-native-vector-icons')
+ compile project(':react-native-image-picker')
compile project(':react-native-google-places')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 7dbf4dd..0fee02e 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -6,6 +6,8 @@
+
+
getPackages() {
return Arrays.asList(
new MainReactPackage(),
+ new VectorIconsPackage(),
+ new ImagePickerPackage(),
new RNGooglePlacesPackage()
);
}
diff --git a/android/settings.gradle b/android/settings.gradle
index 9b0fd6e..c13db23 100644
--- a/android/settings.gradle
+++ b/android/settings.gradle
@@ -1,4 +1,8 @@
rootProject.name = 'AreThereCookies'
+include ':react-native-vector-icons'
+project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
+include ':react-native-image-picker'
+project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-google-places'
project(':react-native-google-places').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-places/android')
diff --git a/ios/AreThereCookies.xcodeproj/project.pbxproj b/ios/AreThereCookies.xcodeproj/project.pbxproj
index 55a1547..26fad3f 100644
--- a/ios/AreThereCookies.xcodeproj/project.pbxproj
+++ b/ios/AreThereCookies.xcodeproj/project.pbxproj
@@ -36,6 +36,18 @@
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
280E457CAD9348CA8B03DD47 /* libRNGooglePlaces.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ABA925E808304E17AEDC016B /* libRNGooglePlaces.a */; };
+ 6D42E5626E694AD8B2E1F392 /* libRNImagePicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B39ECE2FC3546CDBD026A5B /* libRNImagePicker.a */; };
+ 0BB615C49CCD433DA593C478 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BFB7419F05149A0AA3B5196 /* libRNVectorIcons.a */; };
+ 55FDEE79293C4EFA86063F22 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4D75338FE719450A97754019 /* Entypo.ttf */; };
+ 7D83C54E807D47FCBF127E23 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 53F298ED1335413584C3533A /* EvilIcons.ttf */; };
+ 36B20041268B4878A62CE84C /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FF328AF2E4504AAD81574332 /* FontAwesome.ttf */; };
+ 63AD07B6F9C740D4BA67D619 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3BA6445F50EA4148970391C2 /* Foundation.ttf */; };
+ 42F9AC2255DF4556AC6D7967 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 39E5D242E4F44F41AB357CFE /* Ionicons.ttf */; };
+ BC10DD5B7CA14D9D9C7C8041 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 452874387CAA42D7B120E03E /* MaterialCommunityIcons.ttf */; };
+ C45F4C3259C643E7A69C05D8 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C547107D34794AD7B535271C /* MaterialIcons.ttf */; };
+ 2D3494321C8A477BB5FA1C40 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 58F3E8D932CA42CCBE826FCC /* Octicons.ttf */; };
+ 761A158B50BE4290B39D8637 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 28807711BA664F9EB49B3B76 /* SimpleLineIcons.ttf */; };
+ B861BE92B155457990C8500E /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D53B3F694EB44AC8B196FE53 /* Zocial.ttf */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -257,6 +269,20 @@
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
8A9E50571CB24ACDB143CECA /* RNGooglePlaces.xcodeproj */ = {isa = PBXFileReference; name = "RNGooglePlaces.xcodeproj"; path = "../node_modules/react-native-google-places/ios/RNGooglePlaces.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
ABA925E808304E17AEDC016B /* libRNGooglePlaces.a */ = {isa = PBXFileReference; name = "libRNGooglePlaces.a"; path = "libRNGooglePlaces.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
+ 1CDCCD20971D43E3A647B5AA /* RNImagePicker.xcodeproj */ = {isa = PBXFileReference; name = "RNImagePicker.xcodeproj"; path = "../node_modules/react-native-image-picker/ios/RNImagePicker.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
+ 4B39ECE2FC3546CDBD026A5B /* libRNImagePicker.a */ = {isa = PBXFileReference; name = "libRNImagePicker.a"; path = "libRNImagePicker.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
+ ABBDD4481F9A4A879DC2DA9B /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; name = "RNVectorIcons.xcodeproj"; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
+ 5BFB7419F05149A0AA3B5196 /* libRNVectorIcons.a */ = {isa = PBXFileReference; name = "libRNVectorIcons.a"; path = "libRNVectorIcons.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
+ 4D75338FE719450A97754019 /* Entypo.ttf */ = {isa = PBXFileReference; name = "Entypo.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ 53F298ED1335413584C3533A /* EvilIcons.ttf */ = {isa = PBXFileReference; name = "EvilIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ FF328AF2E4504AAD81574332 /* FontAwesome.ttf */ = {isa = PBXFileReference; name = "FontAwesome.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ 3BA6445F50EA4148970391C2 /* Foundation.ttf */ = {isa = PBXFileReference; name = "Foundation.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ 39E5D242E4F44F41AB357CFE /* Ionicons.ttf */ = {isa = PBXFileReference; name = "Ionicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ 452874387CAA42D7B120E03E /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; name = "MaterialCommunityIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ C547107D34794AD7B535271C /* MaterialIcons.ttf */ = {isa = PBXFileReference; name = "MaterialIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ 58F3E8D932CA42CCBE826FCC /* Octicons.ttf */ = {isa = PBXFileReference; name = "Octicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ 28807711BA664F9EB49B3B76 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; name = "SimpleLineIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
+ D53B3F694EB44AC8B196FE53 /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -284,6 +310,8 @@
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
280E457CAD9348CA8B03DD47 /* libRNGooglePlaces.a in Frameworks */,
+ 6D42E5626E694AD8B2E1F392 /* libRNImagePicker.a in Frameworks */,
+ 0BB615C49CCD433DA593C478 /* libRNVectorIcons.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -451,6 +479,8 @@
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
8A9E50571CB24ACDB143CECA /* RNGooglePlaces.xcodeproj */,
+ 1CDCCD20971D43E3A647B5AA /* RNImagePicker.xcodeproj */,
+ ABBDD4481F9A4A879DC2DA9B /* RNVectorIcons.xcodeproj */,
);
name = Libraries;
sourceTree = "";
@@ -471,6 +501,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* AreThereCookiesTests */,
83CBBA001A601CBA00E9B192 /* Products */,
+ F290692D4B774D01965F45E6 /* Resources */,
);
indentWidth = 2;
sourceTree = "";
@@ -487,6 +518,24 @@
name = Products;
sourceTree = "";
};
+ F290692D4B774D01965F45E6 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 4D75338FE719450A97754019 /* Entypo.ttf */,
+ 53F298ED1335413584C3533A /* EvilIcons.ttf */,
+ FF328AF2E4504AAD81574332 /* FontAwesome.ttf */,
+ 3BA6445F50EA4148970391C2 /* Foundation.ttf */,
+ 39E5D242E4F44F41AB357CFE /* Ionicons.ttf */,
+ 452874387CAA42D7B120E03E /* MaterialCommunityIcons.ttf */,
+ C547107D34794AD7B535271C /* MaterialIcons.ttf */,
+ 58F3E8D932CA42CCBE826FCC /* Octicons.ttf */,
+ 28807711BA664F9EB49B3B76 /* SimpleLineIcons.ttf */,
+ D53B3F694EB44AC8B196FE53 /* Zocial.ttf */,
+ );
+ name = Resources;
+ path = "";
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -845,6 +894,16 @@
files = (
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
+ 55FDEE79293C4EFA86063F22 /* Entypo.ttf in Resources */,
+ 7D83C54E807D47FCBF127E23 /* EvilIcons.ttf in Resources */,
+ 36B20041268B4878A62CE84C /* FontAwesome.ttf in Resources */,
+ 63AD07B6F9C740D4BA67D619 /* Foundation.ttf in Resources */,
+ 42F9AC2255DF4556AC6D7967 /* Ionicons.ttf in Resources */,
+ BC10DD5B7CA14D9D9C7C8041 /* MaterialCommunityIcons.ttf in Resources */,
+ C45F4C3259C643E7A69C05D8 /* MaterialIcons.ttf in Resources */,
+ 2D3494321C8A477BB5FA1C40 /* Octicons.ttf in Resources */,
+ 761A158B50BE4290B39D8637 /* SimpleLineIcons.ttf in Resources */,
+ B861BE92B155457990C8500E /* Zocial.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -979,10 +1038,14 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-google-places/ios",
+ "$(SRCROOT)/../node_modules/react-native-image-picker/ios",
+ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
);
};
name = Debug;
@@ -1004,10 +1067,14 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-google-places/ios",
+ "$(SRCROOT)/../node_modules/react-native-image-picker/ios",
+ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
);
};
name = Release;
@@ -1030,6 +1097,8 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-google-places/ios",
+ "$(SRCROOT)/../node_modules/react-native-image-picker/ios",
+ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
);
};
name = Debug;
@@ -1051,6 +1120,8 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-google-places/ios",
+ "$(SRCROOT)/../node_modules/react-native-image-picker/ios",
+ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
);
};
name = Release;
@@ -1081,10 +1152,14 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-google-places/ios",
+ "$(SRCROOT)/../node_modules/react-native-image-picker/ios",
+ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
);
};
name = Debug;
@@ -1115,10 +1190,14 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-google-places/ios",
+ "$(SRCROOT)/../node_modules/react-native-image-picker/ios",
+ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
);
};
name = Release;
@@ -1144,6 +1223,8 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
);
};
name = Debug;
@@ -1169,6 +1250,8 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
+ "\"$(SRCROOT)/$(TARGET_NAME)\"",
);
};
name = Release;
diff --git a/ios/AreThereCookies/Info.plist b/ios/AreThereCookies/Info.plist
index c7dc545..16a07e1 100644
--- a/ios/AreThereCookies/Info.plist
+++ b/ios/AreThereCookies/Info.plist
@@ -1,56 +1,68 @@
-
- CFBundleDevelopmentRegion
- en
- CFBundleDisplayName
- AreThereCookies
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1
- LSRequiresIPhoneOS
-
- UILaunchStoryboardName
- LaunchScreen
- UIRequiredDeviceCapabilities
-
- armv7
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UIViewControllerBasedStatusBarAppearance
-
- NSLocationWhenInUseUsageDescription
-
- NSAppTransportSecurity
-
-
- NSExceptionDomains
-
- localhost
-
- NSExceptionAllowsInsecureHTTPLoads
-
-
-
-
-
-
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDisplayName
+ AreThereCookies
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UIViewControllerBasedStatusBarAppearance
+
+ NSLocationWhenInUseUsageDescription
+
+ NSAppTransportSecurity
+
+ NSExceptionDomains
+
+ localhost
+
+ NSExceptionAllowsInsecureHTTPLoads
+
+
+
+
+ UIAppFonts
+
+ Entypo.ttf
+ EvilIcons.ttf
+ FontAwesome.ttf
+ Foundation.ttf
+ Ionicons.ttf
+ MaterialCommunityIcons.ttf
+ MaterialIcons.ttf
+ Octicons.ttf
+ SimpleLineIcons.ttf
+ Zocial.ttf
+
+
+
\ No newline at end of file
diff --git a/js/components/ImagePicker.js b/js/components/ImagePicker.js
index 922844d..9bbfe1e 100644
--- a/js/components/ImagePicker.js
+++ b/js/components/ImagePicker.js
@@ -3,9 +3,17 @@ import React from 'react';
import { Text, View, TouchableOpacity, Image } from 'react-native';
import { Icon } from 'react-native-material-ui';
import uiTheme from '../ui-theme.js';
+import ReactNativeImagePicker from 'react-native-image-picker';
const { palette: { accentColor } } = uiTheme;
+const openImagePicker = onCreateNew => () =>
+ ReactNativeImagePicker.showImagePicker({}, ({ didCancel, error, uri }) => {
+ if (!didCancel && !error) {
+ onCreateNew(uri);
+ }
+ });
+
export const ImageThumb = ({ uri, onPress }: { uri?: string, onPress: () => void }) =>
@@ -13,7 +21,7 @@ export const ImageThumb = ({ uri, onPress }: { uri?: string, onPress: () => void
export const ImagePicker = ({ children, onCreateNew }: { children?: any, onCreateNew: Function }) =>
-
+
{(!children || !children.length) &&
diff --git a/js/pages/CreateFoodItem.js b/js/pages/CreateFoodItem.js
index 0877424..c5dbfbc 100644
--- a/js/pages/CreateFoodItem.js
+++ b/js/pages/CreateFoodItem.js
@@ -54,9 +54,10 @@ type Props = {
setPlace: (place: typeof PlaceRecord) => void,
removeImageAtIndex: (i: number) => () => void,
updatePlace: (place: GooglePlaceObject) => void,
+ addImage: (uri: string) => void,
};
const CreateFoodItem = (props: Props) => {
- const { foodItem, toggleNameModal, setPropOfFoodItem, place, updatePlace, removeImageAtIndex } = props;
+ const { foodItem, toggleNameModal, setPropOfFoodItem, place, updatePlace, removeImageAtIndex, addImage } = props;
return (
@@ -74,7 +75,7 @@ const CreateFoodItem = (props: Props) => {
style={{ height: 50 }}
/>
- {}}>
+
{foodItem.images.map((image, index) =>
)}
@@ -101,6 +102,9 @@ export default compose(
setPropOfFoodItem: ({ foodItem, setFoodItem }: Props) => (prop: string) => (value: any) => {
setFoodItem(foodItem.set(prop, value));
},
+ addImage: ({ foodItem, setFoodItem }: Props) => (uri: string) => {
+ setFoodItem(foodItem.update('images', images => [uri].concat(images)));
+ },
removeImageAtIndex: ({ foodItem, setFoodItem }: Props) => (index: number) => () => {
setFoodItem(
foodItem.update('images', (images: Array) => {
diff --git a/package.json b/package.json
index 96bbfeb..b63987a 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"react-native": "~0.42.0",
"react-native-drawer": "^2.3.0",
"react-native-google-places": "^2.1.0",
+ "react-native-image-picker": "^0.26.3",
"react-native-looped-carousel": "^0.1.5",
"react-native-material-ui": "^1.7.0",
"react-native-modal": "^2.2.0",
diff --git a/yarn.lock b/yarn.lock
index f927415..435b1a0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3555,6 +3555,10 @@ react-native-google-places@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/react-native-google-places/-/react-native-google-places-2.1.0.tgz#93ceb61b1349fa19d320f32c77b0441985b42d5a"
+react-native-image-picker@^0.26.3:
+ version "0.26.3"
+ resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-0.26.3.tgz#0ad2eede49501a7046d8046a73813696539c3dcd"
+
react-native-looped-carousel@^0.1.5:
version "0.1.7"
resolved "https://registry.yarnpkg.com/react-native-looped-carousel/-/react-native-looped-carousel-0.1.7.tgz#9e81aec732039250568e367383d0bd70ba4173e9"