mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-30 06:45:47 -04:00
refactor: remove show-if in favour of conditionals
This prevents a problem where show-if can trigger an error if a value is checked to exist with it. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8884bbb428
commit
f701f8d05f
52 changed files with 239 additions and 352 deletions
|
@ -11,7 +11,6 @@ import { useFrontendConfig } from '../../common/frontend-config-context/use-fron
|
|||
import { TranslatedExternalLink } from '../../common/links/translated-external-link'
|
||||
import type { CommonModalProps } from '../../common/modals/common-modal'
|
||||
import { CommonModal } from '../../common/modals/common-modal'
|
||||
import { ShowIf } from '../../common/show-if/show-if'
|
||||
import React, { useMemo } from 'react'
|
||||
import { Modal } from 'react-bootstrap'
|
||||
|
||||
|
@ -46,20 +45,20 @@ export const VersionInfoModal: React.FC<CommonModalProps> = ({ onHide, show }) =
|
|||
<Modal.Body>
|
||||
<CopyableField content={backendVersion} />
|
||||
<div className='d-flex justify-content-between mt-3'>
|
||||
<ShowIf condition={!!links.sourceCode}>
|
||||
{links.sourceCode !== undefined && (
|
||||
<TranslatedExternalLink
|
||||
i18nKey={'landing.versionInfo.sourceCode'}
|
||||
className={'btn btn-primary d-block mb-2'}
|
||||
href={links.sourceCode}
|
||||
/>
|
||||
</ShowIf>
|
||||
<ShowIf condition={!!links.issues}>
|
||||
)}
|
||||
{links.issues !== undefined && (
|
||||
<TranslatedExternalLink
|
||||
i18nKey={'landing.versionInfo.issueTracker'}
|
||||
className={'btn btn-primary d-block mb-2'}
|
||||
href={links.issues}
|
||||
/>
|
||||
</ShowIf>
|
||||
)}
|
||||
</div>
|
||||
</Modal.Body>
|
||||
</CommonModal>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue