Skip to content

Commit

Permalink
feat!: migrate to gravity-ui deps and new i18n usage (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marginy605 authored Sep 30, 2022
1 parent efe456f commit 1b4eeb1
Show file tree
Hide file tree
Showing 20 changed files with 225 additions and 179 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["@yandex-cloud/eslint-config", "@yandex-cloud/eslint-config/prettier"],
"extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/prettier"],
"root": true,
"env": {
"node": true
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('@yandex-cloud/prettier-config');
module.exports = require('@gravity-ui/prettier-config');
2 changes: 2 additions & 0 deletions .storybook/decorators/withLang.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import {Story as StoryType, StoryContext} from '@storybook/react';
import {configure as uiKitConfigure, Lang as UILang} from '@gravity-ui/uikit';

import {setLang} from '../../src/utils';

export function withLang(Story: StoryType, context: StoryContext) {
const lang = context.globals.lang;

uiKitConfigure({lang: lang as UILang});
setLang(lang);

return <Story key={lang} {...context} />;
Expand Down
2 changes: 1 addition & 1 deletion .storybook/decorators/withMobile.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {Story as StoryType, StoryContext} from '@storybook/react';
import {useMobile} from '@yandex-cloud/uikit';
import {useMobile} from '@gravity-ui/uikit';

export function withMobile(Story: StoryType, context: StoryContext) {
const mobileValue = context.globals.platform === 'mobile';
Expand Down
2 changes: 1 addition & 1 deletion .storybook/decorators/withTheme.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {Story as StoryType, StoryContext} from '@storybook/react';
import {useTheme} from '@yandex-cloud/uikit';
import {useTheme} from '@gravity-ui/uikit';

export function withTheme(Story: StoryType, context: StoryContext) {
const themeValue = context.globals.theme;
Expand Down
4 changes: 2 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
import '@yandex-cloud/uikit/styles/styles.scss';
import '@gravity-ui/uikit/styles/styles.scss';

import {ThemeProvider, MobileProvider} from '@yandex-cloud/uikit';
import {ThemeProvider, MobileProvider} from '@gravity-ui/uikit';
import React from 'react';
import {MINIMAL_VIEWPORTS} from '@storybook/addon-viewport';
import {CloudTheme} from './theme';
Expand Down
2 changes: 1 addition & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["@yandex-cloud/stylelint-config", "@yandex-cloud/stylelint-config/prettier"]
"extends": ["@gravity-ui/stylelint-config", "@gravity-ui/stylelint-config/prettier"]
}
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A dashboard grid rendering library.
## Installation

```bash
npm i @yandex-cloud/dashkit @yandex-cloud/uikit @yandex-cloud/i18n
npm i @yandex-cloud/dashkit @gravity-ui/uikit @gravity-ui/i18n
```

## Description
Expand Down Expand Up @@ -65,6 +65,16 @@ Before using `DashKit` as a react component, it must be configured.
setLang('en');
```

**From version 3.0.0 the language must be set separately for each DashKit and Gravity-ui instances**

```js
import {setLang} from '@yandex-cloud/dashkit';
import {configure as uiKitConfigure, Lang as UILang} from '@gravity-ui/uikit';

setLang('en');
uiKitConfigure({lang: lang as UILang});
```

- DashKit.setSettings

Used for global DashKit settings (such as margins between widgets, default widget sizes and widget overlay menu)
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ module.exports = {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^(?!.*\\.(js|jsx|ts|tsx|json)$)': '<rootDir>/jest/fileTransform.js',
},
transformIgnorePatterns: ['node_modules/(?!(@yandex-cloud)/)'],
transformIgnorePatterns: ['node_modules/(?!(@gravity-ui)/)'],
snapshotSerializers: ['enzyme-to-json/serializer'],
};
2 changes: 1 addition & 1 deletion jest/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@yandex-cloud/eslint-config/server"
"extends": "@gravity-ui/eslint-config/server"
}
Loading

0 comments on commit 1b4eeb1

Please sign in to comment.