import { Button, View } from "native-base"; import React from "react"; import { Alert, Modal, StyleSheet, Text } from "react-native"; import ImageViewer from "react-native-image-zoom-viewer"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { removePhotos } from "../../redux/photos/photos.actions"; import { selectPhotos } from "../../redux/photos/photos.selectors"; const mapStateToProps = createStructuredSelector({ photos: selectPhotos, }); const mapDispatchToProps = (dispatch) => ({ removePhotos: (ids) => dispatch(removePhotos(ids)), }); export function MediaCacheOverlay({ photos, removePhotos, previewVisible, setPreviewVisible, imgIndex, setImgIndex, }) { return ( { Alert.alert("Modal has been closed."); }} visible={previewVisible} transparent={true} > setPreviewVisible(false)} index={imgIndex} onChange={(index) => setImgIndex(index)} style={{ display: "flex" }} renderFooter={(index) => ( {index} This is the thing. )} enableSwipeDown enablePreload imageUrls={photos.map((p) => { return { url: p.uri }; })} /> ); } const styles = StyleSheet.create({ container: { flex: 1, }, actions: { display: "flex", flexDirection: "row", justifyContent: "space-evenly", }, listContentContainer: { flex: 1, }, thumbnail: { width: 10, height: 10, backgroundColor: "tomato", }, }); export default connect(mapStateToProps, mapDispatchToProps)(MediaCacheOverlay);