mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-03-12 17:02:54 +00: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 { Modal } from 'react-bootstrap'
|
||||
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||
import "./lightbox.scss"
|
||||
|
||||
export const LightboxedImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageElement>> = ({ alt, ...props }) => {
|
||||
const [showFullscreenImage, setShowFullscreenImage] = useState(false)
|
||||
|
@ -17,7 +18,7 @@ export const LightboxedImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageEle
|
|||
<Modal
|
||||
animation={true}
|
||||
centered={true}
|
||||
dialogClassName={'text-dark'}
|
||||
dialogClassName={'text-dark lightbox'}
|
||||
show={showFullscreenImage}
|
||||
onHide={() => setShowFullscreenImage(false)}
|
||||
size={'xl'}>
|
||||
|
|
Loading…
Reference in a new issue