Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(theme): move LayoutProviders to Layout/Provider; composeProv…
…iders util (#7676) Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
- Loading branch information
Showing
7 changed files
with
79 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/docusaurus-theme-classic/src/theme/Layout/Provider/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import {composeProviders} from '@docusaurus/theme-common'; | ||
import { | ||
ColorModeProvider, | ||
TabGroupChoiceProvider, | ||
AnnouncementBarProvider, | ||
DocsPreferredVersionContextProvider, | ||
ScrollControllerProvider, | ||
NavbarProvider, | ||
PluginHtmlClassNameProvider, | ||
} from '@docusaurus/theme-common/internal'; | ||
import type {Props} from '@theme/Layout/Provider'; | ||
|
||
const Provider = composeProviders([ | ||
ColorModeProvider, | ||
AnnouncementBarProvider, | ||
TabGroupChoiceProvider, | ||
ScrollControllerProvider, | ||
DocsPreferredVersionContextProvider, | ||
PluginHtmlClassNameProvider, | ||
NavbarProvider, | ||
]); | ||
|
||
export default function LayoutProvider({children}: Props): JSX.Element { | ||
return <Provider>{children}</Provider>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
packages/docusaurus-theme-classic/src/theme/LayoutProviders/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters