Skip to content

Commit eae9dd4

Browse files
committed
refactor: fix sonar qube errors
1 parent bad09d3 commit eae9dd4

19 files changed

Lines changed: 611 additions & 1233 deletions

File tree

demo/Components/DocPage/components/ServiceLink.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

demo/Components/DocPage/data.ts

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
1-
import type {DocPageProps, DocSettings, Lang} from '@diplodoc/components';
1+
import {createGetContent} from '../shared/get-content';
22

3-
import pageContentEn from './page-en.json';
4-
import pageContentHe from './page-he.json';
5-
import pageContentRu from './page-ru.json';
6-
import singlePageContentEn from './single-page-en.json';
7-
import singlePageContentRu from './single-page-ru.json';
3+
import en from './page-en.json';
4+
import he from './page-he.json';
5+
import ru from './page-ru.json';
6+
import singleEn from './single-page-en.json';
7+
import singleRu from './single-page-ru.json';
88

9-
type Props = Omit<DocPageProps, keyof DocSettings> &
10-
Required<Pick<DocPageProps, keyof DocSettings>>;
11-
12-
export const getContent = (lang: Lang, singlePage: boolean): Props => {
13-
if (singlePage && lang === 'ru') {
14-
return singlePageContentRu as unknown as Props;
15-
} else if (singlePage) {
16-
return singlePageContentEn as unknown as Props;
17-
}
18-
19-
if (lang === 'ru') {
20-
return pageContentRu as unknown as Props;
21-
} else if (lang === 'he') {
22-
return pageContentHe as unknown as Props;
23-
}
24-
25-
return pageContentEn as unknown as Props;
26-
};
9+
export const getContent = createGetContent({en, he, ru, singleEn, singleRu});

0 commit comments

Comments
 (0)