Demo adjustments, resolve upload issues, remove messaging.
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
Button,
|
||||
Container,
|
||||
Content,
|
||||
Spinner,
|
||||
Text as NBText,
|
||||
Thumbnail,
|
||||
View,
|
||||
@@ -15,18 +16,27 @@ import {
|
||||
removeAllPhotos,
|
||||
uploadAllPhotos,
|
||||
} from "../../redux/photos/photos.actions";
|
||||
import { selectPhotos } from "../../redux/photos/photos.selectors";
|
||||
import {
|
||||
selectPhotos,
|
||||
selectUploadInProgress,
|
||||
} from "../../redux/photos/photos.selectors";
|
||||
import MediaCacheOverlay from "../media-cache-overlay/media-cache-overlay.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
photos: selectPhotos,
|
||||
uploadInProgress: selectUploadInProgress,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
removeAllPhotos: () => dispatch(removeAllPhotos()),
|
||||
uploadAllphotos: () => dispatch(uploadAllPhotos()),
|
||||
});
|
||||
|
||||
export function ScreenMediaCache({ photos, removeAllPhotos, uploadAllphotos }) {
|
||||
export function ScreenMediaCache({
|
||||
photos,
|
||||
removeAllPhotos,
|
||||
uploadAllphotos,
|
||||
uploadInProgress,
|
||||
}) {
|
||||
const [previewVisible, setPreviewVisible] = useState(false);
|
||||
const [imgIndex, setImgIndex] = useState(0);
|
||||
const [imagesInDir, setImagesInDir] = useState([]);
|
||||
@@ -42,7 +52,7 @@ export function ScreenMediaCache({ photos, removeAllPhotos, uploadAllphotos }) {
|
||||
photos.length;
|
||||
check();
|
||||
}, [photos]);
|
||||
|
||||
console.log("upinprog", uploadInProgress);
|
||||
return (
|
||||
<Container>
|
||||
<Content>
|
||||
@@ -51,7 +61,8 @@ export function ScreenMediaCache({ photos, removeAllPhotos, uploadAllphotos }) {
|
||||
<NBText>Delete all</NBText>
|
||||
</Button>
|
||||
<Button onPress={() => uploadAllphotos()}>
|
||||
<NBText>Upload all</NBText>
|
||||
<NBText>Upload all </NBText>
|
||||
{uploadInProgress && <Spinner />}
|
||||
</Button>
|
||||
</View>
|
||||
<Text>{`${photos.length} Photos`}</Text>
|
||||
@@ -76,7 +87,6 @@ export function ScreenMediaCache({ photos, removeAllPhotos, uploadAllphotos }) {
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
<MediaCacheOverlay
|
||||
imgIndex={imgIndex}
|
||||
setImgIndex={setImgIndex}
|
||||
|
||||
Reference in New Issue
Block a user