mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-25 12:34:45 -04:00

* Refactor environment variables Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
33 lines
1,011 B
TypeScript
33 lines
1,011 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import React, { Fragment } from 'react'
|
|
import { Trans } from 'react-i18next'
|
|
import { VersionInfoModal } from './version-info-modal'
|
|
import { cypressId } from '../../../../utils/cypress-attribute'
|
|
import { useBooleanState } from '../../../../hooks/common/use-boolean-state'
|
|
import { Button } from 'react-bootstrap'
|
|
|
|
/**
|
|
* Renders a link for the version info and the {@link VersionInfoModal}.
|
|
*/
|
|
export const VersionInfoLink: React.FC = () => {
|
|
const [modalVisibility, showModal, closeModal] = useBooleanState()
|
|
|
|
return (
|
|
<Fragment>
|
|
<Button
|
|
size={'sm'}
|
|
variant={'link'}
|
|
{...cypressId('show-version-modal')}
|
|
className={'text-light p-0'}
|
|
onClick={showModal}>
|
|
<Trans i18nKey={'landing.versionInfo.versionInfo'} />
|
|
</Button>
|
|
<VersionInfoModal onHide={closeModal} show={modalVisibility} />
|
|
</Fragment>
|
|
)
|
|
}
|