mirror of
https://github.com/github/awesome-copilot.git
synced 2026-08-25 10:21:40 +00:00
fix(website): apply ThemeProvider to Playbook article layout so dark mode works
LearningArticleLayout replaces PageShell for Playbook articles but never wrapped itself in a ThemeProvider, so its useTheme() call always fell back to Primer's light default regardless of the site's actual theme preference. Split the component into a thin ThemeProvider wrapper plus the existing implementation (now LearningArticleLayoutBody), matching the pattern already used by PageShell. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 80686fef-efe3-4cdd-8cd6-bfa61a5d0af6
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
Heading,
|
||||
Section,
|
||||
Text,
|
||||
ThemeProvider,
|
||||
useTheme,
|
||||
} from "@primer/react-brand";
|
||||
|
||||
@@ -144,7 +145,15 @@ export type LearningArticleLayoutProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
export function LearningArticleLayout({
|
||||
export function LearningArticleLayout(props: LearningArticleLayoutProps) {
|
||||
return (
|
||||
<ThemeProvider colorMode="auto">
|
||||
<LearningArticleLayoutBody {...props} />
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
function LearningArticleLayoutBody({
|
||||
pageHref,
|
||||
currentPage,
|
||||
breadcrumbLabel,
|
||||
|
||||
Reference in New Issue
Block a user