feat: TOC position for publicly shared docs (#7057)
* feat: TOC position for publicly shared docs * remove preferences object * comment * fix: Allow sidebar position preference without public branding switch --------- Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import { RouteComponentProps, useLocation } from "react-router-dom";
|
||||
import styled, { ThemeProvider } from "styled-components";
|
||||
import { setCookie } from "tiny-cookie";
|
||||
import { s } from "@shared/styles";
|
||||
import { NavigationNode, PublicTeam } from "@shared/types";
|
||||
import { NavigationNode, PublicTeam, TOCPosition } from "@shared/types";
|
||||
import type { Theme } from "~/stores/UiStore";
|
||||
import DocumentModel from "~/models/Document";
|
||||
import Error404 from "~/scenes/Error404";
|
||||
@@ -102,6 +102,7 @@ function SharedDocumentScene(props: Props) {
|
||||
? (searchParams.get("theme") as Theme)
|
||||
: undefined;
|
||||
const theme = useBuildTheme(response?.team?.customTheme, themeOverride);
|
||||
const tocPosition = response?.team?.tocPosition ?? TOCPosition.Left;
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!user) {
|
||||
@@ -188,6 +189,7 @@ function SharedDocumentScene(props: Props) {
|
||||
document={response.document}
|
||||
sharedTree={response.sharedTree}
|
||||
shareId={shareId}
|
||||
tocPosition={tocPosition}
|
||||
readOnly
|
||||
/>
|
||||
</Layout>
|
||||
|
||||
Reference in New Issue
Block a user