Merge remote-tracking branch 'origin/master'

This commit is contained in:
Erick Clark 2017-11-19 12:01:40 -06:00
commit 5e2f45ebb9

View file

@ -3,7 +3,7 @@ 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';
import * as ReactNativeImagePicker from 'react-native-image-picker';
import { type List } from 'immutable';
const { palette: { accentColor } } = uiTheme;
@ -15,21 +15,24 @@ const openImagePicker = onCreateNew => () =>
}
});
export const ImageThumb = ({ uri, onPress }: { uri?: string, onPress: () => void }) =>
export const ImageThumb = ({ uri, onPress }: { uri?: string, onPress: () => void }) => (
<TouchableOpacity onPress={onPress}>
<Image source={{ uri }} style={{ height: 35, width: 35, margin: 5 }} />
</TouchableOpacity>;
</TouchableOpacity>
);
export const ImagePicker = ({ children, onCreateNew }: { children?: List<any>, onCreateNew: Function }) =>
export const ImagePicker = ({ children, onCreateNew }: { children?: List<any>, onCreateNew: Function }) => (
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<TouchableOpacity onPress={openImagePicker(onCreateNew)}>
<View style={{ flexDirection: 'row' }}>
<Icon name="insert-photo" size={35} color={accentColor} style={{ margin: 5 }} />
{(!children || !children.size) &&
{(!children || !children.size) && (
<View style={{ flexDirection: 'column', justifyContent: 'center' }}>
<Text style={{ fontSize: 16 }}>Add Images</Text>
</View>}
</View>
)}
</View>
</TouchableOpacity>
{children}
</View>;
</View>
);