mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 12:07:08 -04:00
Reorganize redux and hooks (1/4) (#985)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
bdf8110676
commit
1b7abf9f27
61 changed files with 898 additions and 986 deletions
|
@ -6,16 +6,14 @@
|
|||
|
||||
import React, { useCallback } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
|
||||
import { useSelector } from 'react-redux'
|
||||
import { ApplicationState } from '../../../redux'
|
||||
import { useNoteMarkdownContent } from '../../../hooks/common/use-note-markdown-content'
|
||||
import { download } from '../../common/download/download'
|
||||
import { SidebarButton } from './sidebar-button'
|
||||
|
||||
export const ExportMarkdownSidebarEntry: React.FC = () => {
|
||||
useTranslation()
|
||||
|
||||
const markdownContent = useSelector((state: ApplicationState) => state.documentContent.content)
|
||||
const markdownContent = useNoteMarkdownContent()
|
||||
const onClick = useCallback(() => {
|
||||
download(markdownContent, `title.md`, 'text/markdown') //todo: replace hard coded title with redux
|
||||
}, [markdownContent])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue