mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
delete baseURL args
Signed-off-by: yamashush <38120991+yamashush@users.noreply.github.com>
This commit is contained in:
parent
744f96852c
commit
dea13bfa90
3 changed files with 4 additions and 7 deletions
|
@ -99,7 +99,7 @@ export const DocumentMarkdownRenderer: React.FC<DocumentMarkdownRendererProps> =
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<DocumentTocSidebar width={internalDocumentRenderPaneSize?.width ?? 0} baseUrl={baseUrl} />
|
<DocumentTocSidebar width={internalDocumentRenderPaneSize?.width ?? 0} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,15 @@ import React, { useState } from 'react'
|
||||||
|
|
||||||
export interface DocumentTocSidebarProps {
|
export interface DocumentTocSidebarProps {
|
||||||
width: number
|
width: number
|
||||||
baseUrl: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DocumentTocSidebar: React.FC<DocumentTocSidebarProps> = ({ width, baseUrl }) => {
|
export const DocumentTocSidebar: React.FC<DocumentTocSidebarProps> = ({ width }) => {
|
||||||
const [tocAst, setTocAst] = useState<TocAst>()
|
const [tocAst, setTocAst] = useState<TocAst>()
|
||||||
useExtensionEventEmitterHandler(TableOfContentsMarkdownExtension.EVENT_NAME, setTocAst)
|
useExtensionEventEmitterHandler(TableOfContentsMarkdownExtension.EVENT_NAME, setTocAst)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.side}>
|
<div className={styles.side}>
|
||||||
{tocAst !== undefined && <WidthBasedTableOfContents tocAst={tocAst} baseUrl={baseUrl} width={width} />}
|
{tocAst !== undefined && <WidthBasedTableOfContents tocAst={tocAst} width={width} />}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import React from 'react'
|
||||||
export interface DocumentExternalTocProps {
|
export interface DocumentExternalTocProps {
|
||||||
tocAst: TocAst
|
tocAst: TocAst
|
||||||
width: number
|
width: number
|
||||||
baseUrl: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_WIDTH_FOR_BUTTON_VISIBILITY = 1100
|
const MAX_WIDTH_FOR_BUTTON_VISIBILITY = 1100
|
||||||
|
@ -23,9 +22,8 @@ const MAX_WIDTH_FOR_BUTTON_VISIBILITY = 1100
|
||||||
*
|
*
|
||||||
* @param tocAst the {@link TocAst AST} that should be rendered.
|
* @param tocAst the {@link TocAst AST} that should be rendered.
|
||||||
* @param width the width that should be used to determine if the button should be shown.
|
* @param width the width that should be used to determine if the button should be shown.
|
||||||
* @param baseUrl the base url that will be used to generate the links //TODO: replace with consumer/provider (https://github.com/hedgedoc/hedgedoc/issues/5035)
|
|
||||||
*/
|
*/
|
||||||
export const WidthBasedTableOfContents: React.FC<DocumentExternalTocProps> = ({ tocAst, width, baseUrl }) => {
|
export const WidthBasedTableOfContents: React.FC<DocumentExternalTocProps> = ({ tocAst, width }) => {
|
||||||
const rendererBaseUrl = useBaseUrl(ORIGIN.RENDERER)
|
const rendererBaseUrl = useBaseUrl(ORIGIN.RENDERER)
|
||||||
|
|
||||||
if (width >= MAX_WIDTH_FOR_BUTTON_VISIBILITY) {
|
if (width >= MAX_WIDTH_FOR_BUTTON_VISIBILITY) {
|
||||||
|
|
Loading…
Reference in a new issue