mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-06 01:21:39 -04:00
Add note loading boundary (#2040)
* Remove redundant equal value Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Add NoteLoadingBoundary to fetch note from API before rendering Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Improve debug message for setHandler Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Add test for boundary Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Use common error page for note loading errors Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Fix tests Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Format code Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Add missing snapshot Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Reformat code Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
0419113d36
commit
880e542351
19 changed files with 282 additions and 166 deletions
|
@ -4,25 +4,20 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React, { Fragment } from 'react'
|
||||
import { useLoadNoteFromServer } from '../../components/editor-page/hooks/useLoadNoteFromServer'
|
||||
import { ShowIf } from '../../components/common/show-if/show-if'
|
||||
import React from 'react'
|
||||
import { EditorToRendererCommunicatorContextProvider } from '../../components/editor-page/render-context/editor-to-renderer-communicator-context-provider'
|
||||
import { SlideShowPageContent } from '../../components/slide-show-page/slide-show-page-content'
|
||||
import { NoteAndAppTitleHead } from '../../components/layout/note-and-app-title-head'
|
||||
import { NoteLoadingBoundary } from '../../components/common/note-loading-boundary/note-loading-boundary'
|
||||
|
||||
export const SlideShowPage: React.FC = () => {
|
||||
const [error, loading] = useLoadNoteFromServer()
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<NoteLoadingBoundary>
|
||||
<NoteAndAppTitleHead />
|
||||
<EditorToRendererCommunicatorContextProvider>
|
||||
<ShowIf condition={!error && !loading}>
|
||||
<SlideShowPageContent />
|
||||
</ShowIf>
|
||||
<SlideShowPageContent />
|
||||
</EditorToRendererCommunicatorContextProvider>
|
||||
</Fragment>
|
||||
</NoteLoadingBoundary>
|
||||
)
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue