mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
![renovate[bot]](/assets/img/avatar_default.png)
* Update dependency eslint-plugin-import to v2.25.2 Signed-off-by: Renovate Bot <bot@renovateapp.com> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Make type imports more explicit Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Enforce use of type imports Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
62 lines
2 KiB
TypeScript
62 lines
2 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import React, { Fragment, useCallback } from 'react'
|
|
import { Trans, useTranslation } from 'react-i18next'
|
|
import links from '../../../links.json'
|
|
import { ExportMarkdownSidebarEntry } from './export-markdown-sidebar-entry'
|
|
import { SidebarButton } from './sidebar-button'
|
|
import { SidebarMenu } from './sidebar-menu'
|
|
import type { SpecificSidebarMenuProps } from './types'
|
|
import { DocumentSidebarMenuSelection } from './types'
|
|
|
|
export const ExportMenuSidebarMenu: React.FC<SpecificSidebarMenuProps> = ({
|
|
className,
|
|
menuId,
|
|
onClick,
|
|
selectedMenuId
|
|
}) => {
|
|
useTranslation()
|
|
|
|
const hide = selectedMenuId !== DocumentSidebarMenuSelection.NONE && selectedMenuId !== menuId
|
|
const expand = selectedMenuId === menuId
|
|
const onClickHandler = useCallback(() => {
|
|
onClick(menuId)
|
|
}, [menuId, onClick])
|
|
|
|
return (
|
|
<Fragment>
|
|
<SidebarButton
|
|
data-cy={'menu-export'}
|
|
hide={hide}
|
|
icon={expand ? 'arrow-left' : 'cloud-download'}
|
|
className={className}
|
|
onClick={onClickHandler}>
|
|
<Trans i18nKey={'editor.documentBar.export'} />
|
|
</SidebarButton>
|
|
<SidebarMenu expand={expand}>
|
|
<SidebarButton icon={'github'}>Gist</SidebarButton>
|
|
<SidebarButton icon={'gitlab'}>Gitlab Snippet</SidebarButton>
|
|
|
|
<ExportMarkdownSidebarEntry />
|
|
|
|
<SidebarButton icon={'file-code-o'}>HTML</SidebarButton>
|
|
<SidebarButton icon={'file-code-o'}>
|
|
<Trans i18nKey='editor.export.rawHtml' />
|
|
</SidebarButton>
|
|
<SidebarButton icon={'file-pdf-o'}>
|
|
<a className='small text-muted' dir={'auto'} href={links.faq} target={'_blank'} rel='noopener noreferrer'>
|
|
<Trans i18nKey={'editor.export.pdf'} />
|
|
|
|
<span className={'text-primary'}>
|
|
<Trans i18nKey={'common.why'} />
|
|
</span>
|
|
</a>
|
|
</SidebarButton>
|
|
</SidebarMenu>
|
|
</Fragment>
|
|
)
|
|
}
|