Removes white space from around images (#81)

* Removes white space from around images

* Add a subtle border
zio/stable
Aryan Goharzad 2023-01-23 21:17:37 -05:00 committed by GitHub
parent 06e41167d0
commit 439305b57e
1 changed files with 10 additions and 7 deletions

View File

@ -25,12 +25,12 @@ export const SelectedPhoto = ({
) )
return selectedPhotos.length !== 0 ? ( return selectedPhotos.length !== 0 ? (
<View testID="selectedPhotosView" style={styles.imageContainer}> <View testID="selectedPhotosView" style={styles.gallery}>
{selectedPhotos.length !== 0 && {selectedPhotos.length !== 0 &&
selectedPhotos.map((item, index) => ( selectedPhotos.map((item, index) => (
<View <View
key={`selected-image-${index}`} key={`selected-image-${index}`}
style={[styles.image, imageStyle]}> style={[styles.imageContainer, imageStyle]}>
<TouchableOpacity <TouchableOpacity
testID="removePhotoButton" testID="removePhotoButton"
onPress={() => handleRemovePhoto(item)} onPress={() => handleRemovePhoto(item)}
@ -54,16 +54,17 @@ export const SelectedPhoto = ({
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
imageContainer: { gallery: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
marginTop: 16, marginTop: 16,
}, },
image: { imageContainer: {
resizeMode: 'contain',
borderRadius: 8,
margin: 2, margin: 2,
backgroundColor: colors.gray1, },
image: {
resizeMode: 'cover',
borderRadius: 8,
}, },
image250: { image250: {
width: 250, width: 250,
@ -88,5 +89,7 @@ const styles = StyleSheet.create({
justifyContent: 'center', justifyContent: 'center',
backgroundColor: colors.black, backgroundColor: colors.black,
zIndex: 1, zIndex: 1,
borderColor: colors.gray4,
borderWidth: 0.5,
}, },
}) })