mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
Limit lightbox size (#923)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
d50e364071
commit
a6996d9414
2 changed files with 13 additions and 1 deletions
|
@ -0,0 +1,11 @@
|
||||||
|
/*!
|
||||||
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
.lightbox img {
|
||||||
|
max-width: calc(100vw - 3.5rem);
|
||||||
|
max-height: calc(100vh - 3.5rem - 75px);
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import React, { Fragment, useState } from 'react'
|
import React, { Fragment, useState } from 'react'
|
||||||
import { Modal } from 'react-bootstrap'
|
import { Modal } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
import "./lightbox.scss"
|
||||||
|
|
||||||
export const LightboxedImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageElement>> = ({ alt, ...props }) => {
|
export const LightboxedImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageElement>> = ({ alt, ...props }) => {
|
||||||
const [showFullscreenImage, setShowFullscreenImage] = useState(false)
|
const [showFullscreenImage, setShowFullscreenImage] = useState(false)
|
||||||
|
@ -17,7 +18,7 @@ export const LightboxedImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageEle
|
||||||
<Modal
|
<Modal
|
||||||
animation={true}
|
animation={true}
|
||||||
centered={true}
|
centered={true}
|
||||||
dialogClassName={'text-dark'}
|
dialogClassName={'text-dark lightbox'}
|
||||||
show={showFullscreenImage}
|
show={showFullscreenImage}
|
||||||
onHide={() => setShowFullscreenImage(false)}
|
onHide={() => setShowFullscreenImage(false)}
|
||||||
size={'xl'}>
|
size={'xl'}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue