Open media gallery item in lightbox

This commit is contained in:
Daniel Gasienica 2018-04-15 02:16:39 -04:00
parent a9f7f18721
commit 0d676a65b8
5 changed files with 46 additions and 7 deletions

View file

@ -592,14 +592,25 @@
);
const mediaWithObjectURLs = await loadMessages(media);
const props = {
const mediaGalleryProps = {
media: mediaWithObjectURLs,
documents: [],
onItemClick: ({message}) => {
const lightboxProps = {
imageURL: message.objectURL,
};
this.lightboxView = new Whisper.ReactWrapperView({
Component: Signal.Components.Lightbox,
props: lightboxProps,
onClose: () => Signal.Backbone.Views.Lightbox.hide(),
});
Signal.Backbone.Views.Lightbox.show(this.lightboxView.el);
}
};
const view = new Whisper.ReactWrapperView({
Component: MediaGallery,
props,
props: mediaGalleryProps,
onClose: () => this.resetPanel(),
});