Skip to content

Commit

Permalink
chore: chore: readme & context direction
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey committed Feb 28, 2024
1 parent 3546288 commit 7503831
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Append js
// In most cases append transform runtime
import "@doc-tools/transform/dist/js/yfm.js";

import {createRoot} from 'react-dom/client';
import {ThemeProvider} from '@gravity-ui/uikit';

// configure components
import {configure as configureUikit} from '@gravity-ui/uikit';
import {configure as configureDocs} from '@diplodoc/components';
Expand All @@ -28,6 +31,14 @@ configureDocs({
// optionally configure allowed translations
loc: {ru, en, tr, ...}
})

// The theme must be applied. To do that wrap your app in ThemeProvider
const root = createRoot(document.getElementById('root'));
root.render(
<ThemeProvider theme="light">
<App />
</ThemeProvider>,
);
```

Append css
Expand Down
2 changes: 1 addition & 1 deletion demo/.storybook/decorators/withTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ThemeProvider} from '@gravity-ui/uikit';

export const WithTheme: Decorator = (Story, context) => {
return (
<ThemeProvider theme={context.globals.theme}>
<ThemeProvider theme={context.globals.theme} direction={context.globals.direction}>
<Story />
</ThemeProvider>
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"dependencies": {
"@gravity-ui/icons": "^2.5.0",
"@gravity-ui/uikit": "^6.0.0",
"@gravity-ui/uikit": "6.0.0",
"@popperjs/core": "^2.11.2",
"bem-cn-lite": "4.1.0",
"i18next": "^19.9.2",
Expand Down

0 comments on commit 7503831

Please sign in to comment.