From 750383145c65e53fd3abe0d0bee7d8bee83add85 Mon Sep 17 00:00:00 2001 From: martyanov-av Date: Wed, 28 Feb 2024 15:18:43 +0300 Subject: [PATCH] chore: chore: readme & context direction --- README.md | 11 +++++++++++ demo/.storybook/decorators/withTheme.tsx | 2 +- package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e54ce57..6c07cf57 100644 --- a/README.md +++ b/README.md @@ -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'; @@ -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( + + + , +); ``` Append css diff --git a/demo/.storybook/decorators/withTheme.tsx b/demo/.storybook/decorators/withTheme.tsx index dc2562d4..6141a46d 100644 --- a/demo/.storybook/decorators/withTheme.tsx +++ b/demo/.storybook/decorators/withTheme.tsx @@ -4,7 +4,7 @@ import {ThemeProvider} from '@gravity-ui/uikit'; export const WithTheme: Decorator = (Story, context) => { return ( - + ); diff --git a/package.json b/package.json index 19245915..fcb12072 100644 --- a/package.json +++ b/package.json @@ -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",