Skip to content

Commit 51a7c6d

Browse files
authored
Merge pull request #3039 from jonchardy/master
Fix: Custom theme icons are not used in the "On This Page" side nav
2 parents 71eb0cf + 1f54ef0 commit 51a7c6d

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

src/lib/output/events.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
type ReflectionKind,
77
} from "../models/index.js";
88
import type { PageDefinition, PageKind, RouterTarget } from "./router.js";
9+
import { type Icons } from "./themes/default/partials/icon.js";
910

1011
/**
1112
* An event emitted by the {@link Renderer} class at the very beginning and
@@ -59,6 +60,7 @@ export interface PageHeading {
5960
level?: number;
6061
kind?: ReflectionKind;
6162
classes?: string;
63+
icon?: keyof Icons & (string | number);
6264
}
6365

6466
/**

src/lib/output/themes/default/partials/member.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function member(context: DefaultThemeRenderContext, props: DeclarationRef
1212
text: getDisplayName(props),
1313
kind: props.kind,
1414
classes: context.getReflectionClasses(props),
15+
icon: context.theme.getReflectionIcon(props),
1516
});
1617

1718
// With the default url derivation, we'll never hit this case as documents are always placed into their

src/lib/output/themes/default/partials/moduleReflection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export function moduleMemberSummary(
8181
text: getDisplayName(member),
8282
kind: member instanceof ReferenceReflection ? member.getTargetReflectionDeep().kind : member.kind,
8383
classes: context.getReflectionClasses(member),
84+
icon: context.theme.getReflectionIcon(member),
8485
});
8586

8687
let name: JSX.Element;

src/lib/output/themes/default/partials/navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function buildSectionNavigation(context: DefaultThemeRenderContext, headings: Pa
190190

191191
levels[levels.length - 1].push(
192192
<a href={heading.link} class={classNames({}, heading.classes)}>
193-
{heading.kind && context.icons[heading.kind]()}
193+
{heading.icon && context.icons[heading.icon]()}
194194
<span>{wbr(heading.text)}</span>
195195
</a>,
196196
);

0 commit comments

Comments
 (0)