From b25488961158ed2aa654d970be38d7d877b144b9 Mon Sep 17 00:00:00 2001 From: Jessica Schilling Date: Fri, 10 Apr 2020 12:16:14 -0600 Subject: [PATCH 1/3] Variable viewer height Makes PDF viewer height take up full screen height Unfortunately can't be based entirely on Tachyons references since fixed pixel heights for assorted header items; suggest eventual rework to fully integrate Tachyons throughout WebUI --- package-lock.json | 2 +- src/files/file-preview/FilePreview.css | 10 ++++++++++ src/files/file-preview/FilePreview.js | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/files/file-preview/FilePreview.css diff --git a/package-lock.json b/package-lock.json index ff8e1cedb..75e8aa526 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ipfs-webui", - "version": "2.7.2", + "version": "2.7.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/files/file-preview/FilePreview.css b/src/files/file-preview/FilePreview.css new file mode 100644 index 000000000..cc963e924 --- /dev/null +++ b/src/files/file-preview/FilePreview.css @@ -0,0 +1,10 @@ +.FilePreviewPDF { + height: calc(100vh - 140px - 5.5rem); + min-height: 100px; +} + +@media only screen and (max-width: 60em) { + .FilePreviewPDF { + height: calc(100vh - 234px - 14rem); + } +} diff --git a/src/files/file-preview/FilePreview.js b/src/files/file-preview/FilePreview.js index 98ffc0b27..e318d4a9c 100644 --- a/src/files/file-preview/FilePreview.js +++ b/src/files/file-preview/FilePreview.js @@ -5,6 +5,7 @@ import isBinary from 'is-binary' import { Trans, withTranslation } from 'react-i18next' import typeFromExt from '../type-from-ext' import ComponentLoader from '../../loader/ComponentLoader.js' +import './FilePreview.css' class Preview extends React.Component { state = { @@ -32,7 +33,7 @@ class Preview extends React.Component { ) case 'pdf': return ( - + {t('noPDFSupport')} {t('downloadPDF')} From 4620335e8b90fa386846029f5ae044088e95261d Mon Sep 17 00:00:00 2001 From: Jessica Schilling Date: Tue, 14 Apr 2020 08:32:48 -0600 Subject: [PATCH 2/3] Update src/files/file-preview/FilePreview.css Comment --- src/files/file-preview/FilePreview.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/files/file-preview/FilePreview.css b/src/files/file-preview/FilePreview.css index cc963e924..f12b2beb0 100644 --- a/src/files/file-preview/FilePreview.css +++ b/src/files/file-preview/FilePreview.css @@ -1,5 +1,5 @@ .FilePreviewPDF { - height: calc(100vh - 140px - 5.5rem); + height: calc(100vh - 140px - 5.5rem); /* 100% of viewport height, minus fixed-height search box and PDF info bar based on font height */ min-height: 100px; } From 634c4c8834bb3fc557472a05fea94290563fea9b Mon Sep 17 00:00:00 2001 From: Jessica Schilling Date: Tue, 14 Apr 2020 08:33:46 -0600 Subject: [PATCH 3/3] Update src/files/file-preview/FilePreview.css Comment --- src/files/file-preview/FilePreview.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/files/file-preview/FilePreview.css b/src/files/file-preview/FilePreview.css index f12b2beb0..18a84eec7 100644 --- a/src/files/file-preview/FilePreview.css +++ b/src/files/file-preview/FilePreview.css @@ -5,6 +5,6 @@ @media only screen and (max-width: 60em) { .FilePreviewPDF { - height: calc(100vh - 234px - 14rem); + height: calc(100vh - 234px - 14rem); /* 100% of viewport height, minus fixed-height search box, page nav header, and PDF info bar based on font height */ } }