Skip to content

Commit 5f083f6

Browse files
authored
feat: use dtinsight/react-icons replace ant-design/icons (#568)
* feat: use dtinsight/react-icons replace ant-design/icons fix #562 * feat: use dtinsight/react-icons replace ant-design/icons * fix: fix lint error
1 parent aa50deb commit 5f083f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+15727
-12619
lines changed

.dumi/pages/index/index.tsx

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

5+
import GithubOutlined from '../../theme/common/GithubOutlined';
66
import './index.scss';
77

88
export default function Homepage() {

.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 { HamburgerOutlined, MenuCloseOutlined } from '@dtinsight/react-icons';
33
import { Button, Tooltip } from 'antd';
44
import { useRouteMeta } from 'dumi';
55
import LangSwitch from 'dumi/theme-default/slots/LangSwitch';
@@ -8,6 +8,7 @@ import Navbar from 'dumi/theme-default/slots/Navbar';
88
import RtlSwitch from 'dumi/theme-default/slots/RtlSwitch';
99
import SearchBar from 'dumi/theme-default/slots/SearchBar';
1010

11+
import GithubOutlined from '../../common/GithubOutlined';
1112
import { useMobile } from '../../hooks';
1213
import 'dumi/theme-default/slots/Header/index.less';
1314
import './index.scss';
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111
"typescript": "~4.5.2"
112112
},
113113
"dependencies": {
114-
"@ant-design/icons": "^4.7.0",
115114
"@dtinsight/dt-utils": "^1.3.1",
115+
"@dtinsight/react-icons": "^1.0.0",
116116
"@handsontable/react": "2.1.0",
117117
"antd": "4.22.5",
118118
"classnames": "^2.2.6",

0 commit comments

Comments
 (0)