mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -04:00
Add prettier for codestyle and re-format everything (#1294)
This commit is contained in:
parent
8b78154075
commit
0aae1f70d2
319 changed files with 4809 additions and 3936 deletions
|
@ -22,7 +22,17 @@ interface OneClickFrameProps {
|
|||
onActivate?: () => void
|
||||
}
|
||||
|
||||
export const OneClickEmbedding: React.FC<OneClickFrameProps> = ({ previewContainerClassName, containerClassName, onImageFetch, loadingImageUrl, children, tooltip, hoverIcon, hoverTextI18nKey, onActivate }) => {
|
||||
export const OneClickEmbedding: React.FC<OneClickFrameProps> = ({
|
||||
previewContainerClassName,
|
||||
containerClassName,
|
||||
onImageFetch,
|
||||
loadingImageUrl,
|
||||
children,
|
||||
tooltip,
|
||||
hoverIcon,
|
||||
hoverTextI18nKey,
|
||||
onActivate
|
||||
}) => {
|
||||
const [showFrame, setShowFrame] = useState(false)
|
||||
const [previewImageUrl, setPreviewImageUrl] = useState(loadingImageUrl)
|
||||
|
||||
|
@ -47,22 +57,24 @@ export const OneClickEmbedding: React.FC<OneClickFrameProps> = ({ previewContain
|
|||
}, [onImageFetch])
|
||||
|
||||
return (
|
||||
<span className={ containerClassName }>
|
||||
<ShowIf condition={ showFrame }>
|
||||
{ children }
|
||||
</ShowIf>
|
||||
<ShowIf condition={ !showFrame }>
|
||||
<span className={ `one-click-embedding ${ previewContainerClassName || '' }` } onClick={ showChildren }>
|
||||
<ShowIf condition={ !!previewImageUrl }>
|
||||
<ProxyImageFrame className={ 'one-click-embedding-preview' } src={ previewImageUrl } alt={ tooltip || '' }
|
||||
title={ tooltip || '' }/>
|
||||
<span className={containerClassName}>
|
||||
<ShowIf condition={showFrame}>{children}</ShowIf>
|
||||
<ShowIf condition={!showFrame}>
|
||||
<span className={`one-click-embedding ${previewContainerClassName || ''}`} onClick={showChildren}>
|
||||
<ShowIf condition={!!previewImageUrl}>
|
||||
<ProxyImageFrame
|
||||
className={'one-click-embedding-preview'}
|
||||
src={previewImageUrl}
|
||||
alt={tooltip || ''}
|
||||
title={tooltip || ''}
|
||||
/>
|
||||
</ShowIf>
|
||||
<ShowIf condition={ !!hoverIcon }>
|
||||
<ShowIf condition={!!hoverIcon}>
|
||||
<span className='one-click-embedding-icon text-center'>
|
||||
<i className={ `fa fa-${ hoverIcon as string } fa-5x mb-2` }/>
|
||||
<ShowIf condition={ !!hoverTextI18nKey }>
|
||||
<br/>
|
||||
<Trans i18nKey={ hoverTextI18nKey }/>
|
||||
<i className={`fa fa-${hoverIcon as string} fa-5x mb-2`} />
|
||||
<ShowIf condition={!!hoverTextI18nKey}>
|
||||
<br />
|
||||
<Trans i18nKey={hoverTextI18nKey} />
|
||||
</ShowIf>
|
||||
</span>
|
||||
</ShowIf>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue