From 934f3b271a2e5a58dd58472d4b5dfb773374d4eb Mon Sep 17 00:00:00 2001 From: btzr-io Date: Sun, 26 May 2019 00:18:47 -0600 Subject: [PATCH] improve fullscreen mode of the viewer --- src/ui/component/fileActions/view.jsx | 21 +++++++++++- src/ui/component/fileViewer/view.jsx | 49 +++++++++++++++++++++++---- src/ui/constants/icons.js | 1 + src/ui/index.jsx | 7 ++++ src/ui/page/file/view.jsx | 11 ++++-- src/ui/scss/component/_content.scss | 5 +++ 6 files changed, 84 insertions(+), 10 deletions(-) diff --git a/src/ui/component/fileActions/view.jsx b/src/ui/component/fileActions/view.jsx index 4ae00a8d1..f7e64bc5b 100644 --- a/src/ui/component/fileActions/view.jsx +++ b/src/ui/component/fileActions/view.jsx @@ -15,15 +15,34 @@ type Props = { openModal: (id: string, { uri: string }) => void, claimIsMine: boolean, fileInfo: FileInfo, + showFullscreen: boolean, }; class FileActions extends React.PureComponent { + MaximizeViewer() { + // Get viewer container + const viewer = document.getElementsByClassName('content__embedded')[0]; + viewer.webkitRequestFullscreen(); + } + render() { - const { fileInfo, uri, openModal, claimIsMine, claimId } = this.props; + const { fileInfo, uri, openModal, claimIsMine, claimId, showFullscreen } = this.props; const showDelete = claimIsMine || (fileInfo && Object.keys(fileInfo).length > 0); return ( + {showFullscreen && ( + +