mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 09:16:30 -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>
|
||||
<DocumentTocSidebar width={internalDocumentRenderPaneSize?.width ?? 0} baseUrl={baseUrl} />
|
||||
<DocumentTocSidebar width={internalDocumentRenderPaneSize?.width ?? 0} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -12,16 +12,15 @@ import React, { useState } from 'react'
|
|||
|
||||
export interface DocumentTocSidebarProps {
|
||||
width: number
|
||||
baseUrl: string
|
||||
}
|
||||
|
||||
export const DocumentTocSidebar: React.FC<DocumentTocSidebarProps> = ({ width, baseUrl }) => {
|
||||
export const DocumentTocSidebar: React.FC<DocumentTocSidebarProps> = ({ width }) => {
|
||||
const [tocAst, setTocAst] = useState<TocAst>()
|
||||
useExtensionEventEmitterHandler(TableOfContentsMarkdownExtension.EVENT_NAME, setTocAst)
|
||||
|
||||
return (
|
||||
<div className={styles.side}>
|
||||
{tocAst !== undefined && <WidthBasedTableOfContents tocAst={tocAst} baseUrl={baseUrl} width={width} />}
|
||||
{tocAst !== undefined && <WidthBasedTableOfContents tocAst={tocAst} width={width} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import React from 'react'
|
|||
export interface DocumentExternalTocProps {
|
||||
tocAst: TocAst
|
||||
width: number
|
||||
baseUrl: string
|
||||
}
|
||||
|
||||
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 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)
|
||||
|
||||
if (width >= MAX_WIDTH_FOR_BUTTON_VISIBILITY) {
|
||||
|
|
Loading…
Reference in a new issue