mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-30 14:55:27 -04:00
Expand image button (#570)
added full-screen image modal when clicking on img's Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
553cd3577d
commit
cac9b7ea37
8 changed files with 55 additions and 7 deletions
|
@ -8,14 +8,15 @@ import { ShowIf } from '../show-if/show-if'
|
|||
export interface CommonModalProps {
|
||||
show: boolean
|
||||
onHide: () => void
|
||||
titleI18nKey: string
|
||||
titleI18nKey?: string
|
||||
title?: string
|
||||
closeButton?: boolean
|
||||
icon?: IconName
|
||||
size?: 'lg' | 'sm' | 'xl'
|
||||
additionalClasses?: string
|
||||
}
|
||||
|
||||
export const CommonModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, closeButton, icon, additionalClasses, size, children }) => {
|
||||
export const CommonModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, title, closeButton, icon, additionalClasses, size, children }) => {
|
||||
useTranslation()
|
||||
|
||||
return (
|
||||
|
@ -25,7 +26,10 @@ export const CommonModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18
|
|||
<ShowIf condition={!!icon}>
|
||||
<ForkAwesomeIcon icon={icon as IconName}/>
|
||||
</ShowIf>
|
||||
<Trans i18nKey={titleI18nKey}/>
|
||||
{ titleI18nKey
|
||||
? <Trans i18nKey={titleI18nKey}/>
|
||||
: <span>{title}</span>
|
||||
}
|
||||
</Modal.Title>
|
||||
</Modal.Header>
|
||||
{ children }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue