mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
Adapt react-client to use the real backend API (#1545)
Co-authored-by: Philip Molares <philip.molares@udo.edu> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
3399ed2023
commit
26f90505ff
227 changed files with 4726 additions and 2310 deletions
|
@ -7,31 +7,25 @@
|
|||
import React, { Fragment } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { updateNoteTitleByFirstHeading } from '../../redux/note-details/methods'
|
||||
import { useApplicationState } from '../../hooks/common/use-application-state'
|
||||
import { useSendFrontmatterInfoFromReduxToRenderer } from '../editor-page/renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer'
|
||||
import { DocumentInfobar } from './document-infobar'
|
||||
import { RenderIframe } from '../editor-page/renderer-pane/render-iframe'
|
||||
import { RendererType } from '../render-page/window-post-message-communicator/rendering-message'
|
||||
import { useTrimmedNoteMarkdownContentWithoutFrontmatter } from '../../hooks/common/use-trimmed-note-markdown-content-without-frontmatter'
|
||||
|
||||
/**
|
||||
* Renders the read-only version of a note with a header bar that contains information about the note.
|
||||
*/
|
||||
export const DocumentReadOnlyPageContent: React.FC = () => {
|
||||
useTranslation()
|
||||
|
||||
const markdownContentLines = useTrimmedNoteMarkdownContentWithoutFrontmatter()
|
||||
const noteDetails = useApplicationState((state) => state.noteDetails)
|
||||
useSendFrontmatterInfoFromReduxToRenderer()
|
||||
|
||||
// TODO Change todo values with real ones as soon as the backend is ready.
|
||||
return (
|
||||
<Fragment>
|
||||
<DocumentInfobar
|
||||
changedAuthor={noteDetails.lastChange.username ?? ''}
|
||||
changedTime={noteDetails.lastChange.timestamp}
|
||||
createdAuthor={'Test'}
|
||||
createdTime={noteDetails.createTime}
|
||||
editable={true}
|
||||
noteId={noteDetails.id}
|
||||
viewCount={noteDetails.viewCount}
|
||||
/>
|
||||
<DocumentInfobar />
|
||||
<RenderIframe
|
||||
frameClasses={'flex-fill h-100 w-100'}
|
||||
markdownContentLines={markdownContentLines}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue