Skip to content

Commit f5f8629

Browse files
committed
feat: use dtinsight/react-icons replace ant-design/icons
1 parent a836cc5 commit f5f8629

File tree

32 files changed

+177
-2944
lines changed

32 files changed

+177
-2944
lines changed

.dumi/pages/index/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
2-
import { GithubOutlined } from '@ant-design/icons';
32
import { Button } from 'antd';
43
import { Helmet, Link } from 'dumi';
54

65
import './index.scss';
6+
import GithubOutlined from '../../theme/common/GithubOutlined';
77

88
export default function Homepage() {
99
return (

.dumi/theme/common/GithubOutlined.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
3+
const GithubOutlined = () => {
4+
return (
5+
<span className="anticon">
6+
<svg
7+
xmlns="http://www.w3.org/2000/svg"
8+
width="1em"
9+
height="1em"
10+
viewBox="0 0 1024 1024"
11+
>
12+
<path d="M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z" />
13+
</svg>
14+
</span>
15+
);
16+
};
17+
18+
export default GithubOutlined;

.dumi/theme/slots/Header/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import { CloseOutlined, GithubOutlined, MenuOutlined } from '@ant-design/icons';
2+
import { MenuCloseOutlined, HamburgerOutlined } from '@dtinsight/react-icons';
33
import { Button, Tooltip } from 'antd';
44
import { useRouteMeta } from 'dumi';
55
import LangSwitch from 'dumi/theme-default/slots/LangSwitch';
@@ -11,6 +11,7 @@ import SearchBar from 'dumi/theme-default/slots/SearchBar';
1111
import { useMobile } from '../../hooks';
1212
import 'dumi/theme-default/slots/Header/index.less';
1313
import './index.scss';
14+
import GithubOutlined from '../../common/GithubOutlined';
1415

1516
export default function Header() {
1617
const { frontmatter } = useRouteMeta();
@@ -64,7 +65,7 @@ export default function Header() {
6465
setShowMenu((v) => !v);
6566
}}
6667
>
67-
{showMenu ? <CloseOutlined /> : <MenuOutlined />}
68+
{showMenu ? <MenuCloseOutlined /> : <HamburgerOutlined />}
6869
</button>
6970
</div>
7071
</div>

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ module.exports = {
1313
'@babel/polyfill/lib/noConflict': '<rootDir>/tests/styleMock.js',
1414
'^lodash-es$': 'lodash',
1515
'react-markdown': '<rootDir>/node_modules/react-markdown/react-markdown.min.js',
16+
'@dtinsight/react-icons': '<rootDir>/tests/iconMock.js',
1617
},
1718
};

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
"typescript": "~4.5.2"
112112
},
113113
"dependencies": {
114-
"@ant-design/icons": "^4.7.0",
115114
"@dtinsight/dt-utils": "^1.3.1",
116115
"@dtinsight/react-icons": "^1.0.0",
117116
"@handsontable/react": "2.1.0",

pnpm-lock.yaml

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/blockHeader/__tests__/blockHeader.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe('test BlockHeader render', () => {
115115
const { container } = render(<BlockHeader {...props3} />);
116116
const wrap = container.firstChild!;
117117
const tooltipWrap = wrap.firstChild!.firstChild!.lastChild;
118-
expect(tooltipWrap!.firstChild).toHaveClass('anticon-question-circle');
118+
expect(tooltipWrap!.firstChild).toHaveAttribute('data-mock-icon', 'QuestionOutlined');
119119
});
120120

121121
test('should render BlockHeader description success', () => {

src/catalogue/demos/config.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useEffect } from 'react';
2-
import { DeleteOutlined, EditOutlined, PlusSquareOutlined } from '@ant-design/icons';
2+
import { DeleteOutlined, EditOutlined, PlusSquareOutlined } from '@dtinsight/react-icons';
33
import { Menu } from 'antd';
44
import { Catalogue, EllipsisText } from 'dt-react-component';
55
import { CatalogueProps } from 'dt-react-component/catalogue/components/catalogue';
66
import { ITreeNode, useTreeData } from 'dt-react-component/catalogue/useTreeData';
7-
import { cloneDeep } from 'lodash';
7+
import { cloneDeep } from 'lodash-es';
88
import shortid from 'shortid';
99

1010
import {

src/catalogue/demos/drag.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useEffect } from 'react';
2-
import { DeleteOutlined, EditOutlined, PlusSquareOutlined } from '@ant-design/icons';
2+
import { DeleteOutlined, EditOutlined, PlusSquareOutlined } from '@dtinsight/react-icons';
33
import { Menu } from 'antd';
44
import { Catalogue } from 'dt-react-component';
55
import { CatalogueProps } from 'dt-react-component/catalogue/components/catalogue';
66
import { ITreeNode, useTreeData } from 'dt-react-component/catalogue/useTreeData';
7-
import { cloneDeep } from 'lodash';
7+
import { cloneDeep } from 'lodash-es';
88
import shortid from 'shortid';
99

1010
import {

src/catalogue/demos/operator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React, { useEffect } from 'react';
2-
import { DeleteOutlined, EditOutlined, PlusSquareOutlined } from '@ant-design/icons';
2+
import { DeleteOutlined, EditOutlined, PlusSquareOutlined } from '@dtinsight/react-icons';
33
import { Menu } from 'antd';
44
import { Catalogue } from 'dt-react-component';
55
import { ITreeNode, useTreeData } from 'dt-react-component/catalogue/useTreeData';
6-
import { cloneDeep } from 'lodash';
6+
import { cloneDeep } from 'lodash-es';
77
import shortid from 'shortid';
88

99
import {

0 commit comments

Comments
 (0)