Open media gallery item in lightbox
This commit is contained in:
parent
a9f7f18721
commit
0d676a65b8
5 changed files with 46 additions and 7 deletions
|
@ -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(),
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue