Skip to content

Commit

Permalink
fix(theme): set outline title in mobile view to `themeConfig.outlineT…
Browse files Browse the repository at this point in the history
…itle` (#969)

Co-authored-by: Timeless0911 <[email protected]>
  • Loading branch information
maomao1996 and Timeless0911 authored Apr 18, 2024
1 parent 12efbeb commit 5f15309
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/green-eagles-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rspress/theme-default": patch
---

Set outline title in mobile view to `themeConfig.outlineTitle`
4 changes: 3 additions & 1 deletion packages/theme-default/src/components/LocalSideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import { SvgWrapper } from '../SvgWrapper';
import { CSSTransition } from 'react-transition-group';

export function SideMenu({
outlineTitle,
beforeSidebar,
afterSidebar,
uiSwitch,
}: {
outlineTitle: string;
beforeSidebar?: React.ReactNode;
afterSidebar?: React.ReactNode;
uiSwitch?: UISwitchResult;
Expand Down Expand Up @@ -76,7 +78,7 @@ export function SideMenu({
className="flex-center ml-auto"
ref={outlineButtonRef}
>
<span className="text-sm">On this page</span>
<span className="text-sm">{outlineTitle}</span>
<div
className="text-md mr-2"
style={{
Expand Down
1 change: 1 addition & 0 deletions packages/theme-default/src/layout/DocLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function DocLayout(props: DocLayoutProps) {
>
{beforeDoc}
<SideMenu
outlineTitle={outlineTitle}
beforeSidebar={beforeSidebar}
afterSidebar={afterSidebar}
uiSwitch={uiSwitch}
Expand Down

0 comments on commit 5f15309

Please sign in to comment.