Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(theme): set outline title in mobile view to themeConfig.outlineTitle #969

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading