mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 23:54:42 -04:00
Change top slide mode button dynamically to read-only-mode (#1056)
This commit is contained in:
parent
f9809a4edf
commit
7dd91c7b46
5 changed files with 89 additions and 17 deletions
27
src/components/editor-page/app-bar/read-only-mode-button.tsx
Normal file
27
src/components/editor-page/app-bar/read-only-mode-button.tsx
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { Button } from 'react-bootstrap'
|
||||
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useParams } from 'react-router'
|
||||
import { EditorPagePathParams } from '../editor-page'
|
||||
|
||||
export const ReadOnlyModeButton: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
const { id } = useParams<EditorPagePathParams>()
|
||||
|
||||
return (
|
||||
<Link to={ `/s/${ id }` } target='_blank'>
|
||||
<Button title={ t('editor.documentBar.readOnlyMode') } className="ml-2 text-secondary" size="sm"
|
||||
variant="outline-light">
|
||||
<ForkAwesomeIcon icon="file-text-o"/>
|
||||
</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue