Skip to content

Commit 91353b7

Browse files
committed
fix(icon): remove icon and use @dtinsight/react-icons
1 parent f687f07 commit 91353b7

File tree

12 files changed

+36
-315
lines changed

12 files changed

+36
-315
lines changed

src/catalogue/components/catalogue.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import React, { useState } from 'react';
2+
import {
3+
CatalogFilled,
4+
CloseOutlined,
5+
DragOutlined,
6+
EllipsisTableOutlined,
7+
SearchOutlined,
8+
} from '@dtinsight/react-icons';
29
import { Dropdown, DropdownProps, Form, Input, Tabs } from 'antd';
310
import { BlockHeader, EllipsisText } from 'dt-react-component';
411
import { IBlockHeaderProps } from 'dt-react-component/blockHeader';
512

613
import { ITreeNode } from '../useTreeData';
7-
import { CatalogIcon, CloseIcon, DragIcon, EllipsisIcon, SearchIcon } from './icon';
814
import CatalogueTree, { ICatalogueTree } from './tree';
915

1016
interface Tab {
@@ -51,7 +57,7 @@ const Catalogue = <U extends Record<string, any> = {}, T extends readOnlyTab = a
5157
) => {
5258
const {
5359
title,
54-
addonBefore = <CatalogIcon style={{ fontSize: 20 }} />,
60+
addonBefore = <CatalogFilled style={{ fontSize: 20 }} />,
5561
tooltip = false,
5662
showSearch = false,
5763
placeholder = '搜索目录名称',
@@ -124,7 +130,7 @@ const Catalogue = <U extends Record<string, any> = {}, T extends readOnlyTab = a
124130
<div className="dt-catalogue__search">
125131
<Input.Search placeholder={placeholder} onSearch={onSearch} />
126132
{isTabMode(props) && (
127-
<CloseIcon className="close" style={{}} onClick={() => setTabSearch(false)} />
133+
<CloseOutlined className="close" onClick={() => setTabSearch(false)} />
128134
)}
129135
</div>
130136
);
@@ -138,7 +144,7 @@ const Catalogue = <U extends Record<string, any> = {}, T extends readOnlyTab = a
138144
className="dt-catalogue__tabs"
139145
size="small"
140146
tabBarExtraContent={
141-
<SearchIcon className="search" onClick={() => setTabSearch(true)} />
147+
<SearchOutlined className="search" onClick={() => setTabSearch(true)} />
142148
}
143149
activeKey={activeTabKey}
144150
onChange={onTabChange}
@@ -177,10 +183,10 @@ const Catalogue = <U extends Record<string, any> = {}, T extends readOnlyTab = a
177183
triggerNode.parentElement as HTMLElement
178184
}
179185
>
180-
<EllipsisIcon onClick={(e) => e.stopPropagation()} />
186+
<EllipsisTableOutlined onClick={(e) => e.stopPropagation()} />
181187
</Dropdown>
182188
)}
183-
{draggable && <DragIcon />}
189+
{draggable && <DragOutlined />}
184190
</div>
185191
);
186192
};

src/catalogue/components/icon.tsx

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

src/catalogue/components/tree.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useMemo } from 'react';
2+
import { DownTriangleFilled } from '@dtinsight/react-icons';
23
import { Spin, Tree, TreeProps } from 'antd';
34
import { Empty } from 'dt-react-component';
45

56
import { ITreeNode } from '../useTreeData';
67
import { loopTree } from '../utils';
7-
import { DownTriangleIcon } from './icon';
88

99
export interface ICatalogueTree<T extends Record<string, any> = {}>
1010
extends Omit<TreeProps, 'showLine' | 'switcherIcon' | 'showIcon' | 'treeData' | 'titleRender'> {
@@ -28,7 +28,7 @@ const CatalogueTree = <T extends Record<string, any> = {}>({
2828
<Spin spinning={loading}>
2929
<Tree<ITreeNode<T>>
3030
showLine={{ showLeafIcon: false }}
31-
switcherIcon={<DownTriangleIcon style={{ fontSize: 16 }} />}
31+
switcherIcon={<DownTriangleFilled style={{ fontSize: 16 }} />}
3232
showIcon
3333
treeData={renderTreeData}
3434
titleRender={titleRender}

src/catalogue/demos/basic.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from 'react';
2-
import { Catalogue, EllipsisText } from 'dt-react-component';
2+
import { Catalogue } from 'dt-react-component';
33
import { useTreeData } from 'dt-react-component/catalogue/useTreeData';
44

55
const DEFAULT_DATA = [
@@ -8,12 +8,7 @@ const DEFAULT_DATA = [
88
key: '0-0',
99
children: [
1010
{
11-
title: (
12-
<EllipsisText
13-
value="长长长长长长长长长长长长长长长长长长长长长长长长Title"
14-
maxWidth="100%"
15-
/>
16-
),
11+
title: '长长长长长长长长长长长长长长长长长长长长长长长长Title',
1712
key: '0-0-0',
1813
children: [
1914
{ title: '0-0-0-0', key: '0-0-0-0' },

src/catalogue/demos/config.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect } from 'react';
22
import { DeleteOutlined, EditOutlined, PlusSquareOutlined } from '@dtinsight/react-icons';
33
import { Menu } from 'antd';
4-
import { Catalogue, EllipsisText } from 'dt-react-component';
4+
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';
77
import { cloneDeep } from 'lodash-es';
@@ -23,12 +23,7 @@ const DEFAULT_DATA: ITreeNode<IData>[] = [
2323
key: '0-0',
2424
children: [
2525
{
26-
title: (
27-
<EllipsisText
28-
value="长长长长长长长长长长长长长长长长长长长长长长长长Title"
29-
maxWidth="100%"
30-
/>
31-
),
26+
title: '长长长长长长长长长长长长长长长长长长长长长长长长Title',
3227
key: '0-0-0',
3328
children: [
3429
{

src/catalogue/demos/simple.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from 'react';
2-
import { Catalogue, EllipsisText } from 'dt-react-component';
2+
import { Catalogue } from 'dt-react-component';
33
import { useTreeData } from 'dt-react-component/catalogue/useTreeData';
44

55
const DEFAULT_DATA = [
@@ -8,12 +8,7 @@ const DEFAULT_DATA = [
88
key: '0-0',
99
children: [
1010
{
11-
title: (
12-
<EllipsisText
13-
value="长长长长长长长长长长长长长长长长长长长长长长长长Title"
14-
maxWidth="100%"
15-
/>
16-
),
11+
title: '长长长长长长长长长长长长长长长长长长长长长长长长Title',
1712
key: '0-0-0',
1813
children: [
1914
{ title: '0-0-0-0', key: '0-0-0-0' },

src/catalogue/demos/tabs.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from 'react';
2-
import { Catalogue, EllipsisText } from 'dt-react-component';
2+
import { Catalogue } from 'dt-react-component';
33
import { useTreeData } from 'dt-react-component/catalogue/useTreeData';
44

55
enum TreeType {
@@ -13,12 +13,7 @@ const DEFAULT_DATA = (key: TreeType) => [
1313
key: '0-0',
1414
children: [
1515
{
16-
title: (
17-
<EllipsisText
18-
value="长长长长长长长长长长长长长长长长长长长长长长长长Title"
19-
maxWidth="100%"
20-
/>
21-
),
16+
title: '长长长长长长长长长长长长长长长长长长长长长长长长Title',
2217
key: '0-0-0',
2318
children: [
2419
{ title: '0-0-0-0', key: '0-0-0-0' },

src/catalogue/utils.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2+
import { FolderFilled, FolderOpenedFilled } from '@dtinsight/react-icons';
23

34
import { CatalogueProps } from './components/catalogue';
4-
import { FolderIcon, FolderOpenedIcon } from './components/icon';
55
import { ITreeNode } from './useTreeData';
66

77
export const getIcon: ITreeNode['icon'] = ({ selected, expanded }) => {
@@ -10,8 +10,8 @@ export const getIcon: ITreeNode['icon'] = ({ selected, expanded }) => {
1010
color: '#1D78FF',
1111
};
1212

13-
if (expanded || selected) return <FolderOpenedIcon style={styles} />;
14-
return <FolderIcon style={styles} />;
13+
if (expanded || selected) return <FolderOpenedFilled style={styles} />;
14+
return <FolderFilled style={styles} />;
1515
};
1616

1717
/**
File renamed without changes.

src/empty/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
22
import { Empty as AntdEmpty, EmptyProps as AntdEmptyProps } from 'antd';
33
import classNames from 'classnames';
44

5-
import { LoupeIcon, SearchIcon } from '../components/icon';
5+
import { LoupeIcon, SearchIcon } from './icon';
66
import './style.scss';
77

88
export const IMG_MAP = {

0 commit comments

Comments
 (0)