Skip to content

Commit

Permalink
add ThemeProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey committed Feb 28, 2024
1 parent d28ef49 commit 2d9681f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
14 changes: 8 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"./styles": "./build/client/app.css"
},
"dependencies": {
"@diplodoc/components": "^3.6.0",
"@diplodoc/components": "^3.10.0-beta.1",
"@diplodoc/latex-extension": "^1.0.2",
"@diplodoc/mermaid-extension": "^1.2.1",
"@diplodoc/openapi-extension": "^2.0.0",
"@diplodoc/transform": "^4.10.3",
"@gravity-ui/page-constructor": "^4.24.0",
"@gravity-ui/uikit": "6.0.0",
"@gravity-ui/uikit": "^6.0.0",
"bem-cn-lite": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
16 changes: 10 additions & 6 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
PageConstructor,
PageConstructorProvider,
} from '@gravity-ui/page-constructor';
import {ThemeProvider} from '@gravity-ui/uikit';
import {
DocLeadingPage,
DocLeadingPageData,
Expand Down Expand Up @@ -70,12 +71,15 @@ function Page(props: DocInnerProps) {
const Page = data.leading ? DocLeadingPage : DocPage;

return (
<Layout>
<Layout.Content>
{/*@ts-ignore*/}
<Page {...data} {...pageProps} />
</Layout.Content>
</Layout>
<ThemeProvider theme={pageProps?.theme} direction={pageProps?.direction}>
<Layout>
<Layout.Content>
{/*@ts-ignore*/}
<Page {...data} {...pageProps} />
</Layout.Content>
</Layout>
</ThemeProvider>

);
}

Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function config({isServer, isDev, analyze = false}) {
fallback: {
stream: false,
crypto: false,
url: require.resolve("url/"),
},
extensions: (isServer
? ['.server.tsx', '.server.ts', '.server.js']
Expand Down

0 comments on commit 2d9681f

Please sign in to comment.