mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -04:00
fix: Move content into to frontend directory
Doing this BEFORE the merge prevents a lot of merge conflicts. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4e18ce38f3
commit
762a0a850e
1051 changed files with 0 additions and 35 deletions
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React, { useMemo } from 'react'
|
||||
import {
|
||||
CommunicationMessageType,
|
||||
RendererType
|
||||
} from '../render-page/window-post-message-communicator/rendering-message'
|
||||
import { RenderIframe } from '../editor-page/renderer-pane/render-iframe'
|
||||
import { updateNoteTitleByFirstHeading } from '../../redux/note-details/methods'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useTrimmedNoteMarkdownContentWithoutFrontmatter } from '../../hooks/common/use-trimmed-note-markdown-content-without-frontmatter'
|
||||
import { useSendToRenderer } from '../render-page/window-post-message-communicator/hooks/use-send-to-renderer'
|
||||
import { useApplicationState } from '../../hooks/common/use-application-state'
|
||||
import { setRendererStatus } from '../../redux/renderer-status/methods'
|
||||
|
||||
/**
|
||||
* Renders the current markdown content as a slideshow.
|
||||
*/
|
||||
export const SlideShowPageContent: React.FC = () => {
|
||||
const markdownContentLines = useTrimmedNoteMarkdownContentWithoutFrontmatter()
|
||||
useTranslation()
|
||||
|
||||
const slideOptions = useApplicationState((state) => state.noteDetails.frontmatter.slideOptions)
|
||||
const rendererReady = useApplicationState((state) => state.rendererStatus.rendererReady)
|
||||
useSendToRenderer(
|
||||
useMemo(
|
||||
() => ({
|
||||
type: CommunicationMessageType.SET_SLIDE_OPTIONS,
|
||||
slideOptions
|
||||
}),
|
||||
[slideOptions]
|
||||
),
|
||||
rendererReady
|
||||
)
|
||||
|
||||
return (
|
||||
<div className={'vh-100 vw-100'}>
|
||||
<RenderIframe
|
||||
frameClasses={'h-100 w-100'}
|
||||
markdownContentLines={markdownContentLines}
|
||||
rendererType={RendererType.SLIDESHOW}
|
||||
onFirstHeadingChange={updateNoteTitleByFirstHeading}
|
||||
onRendererStatusChange={setRendererStatus}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue