Skip to content

Commit

Permalink
feat: antd 4.x icon
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyi committed Sep 7, 2022
1 parent b98f78a commit 2ab9d42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
25 changes: 7 additions & 18 deletions src/stories/mxGraph.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import React from 'react';
import ReactDOMServer from 'react-dom/server';
import { State, Store } from '@sambego/storybook-state';
import { storiesOf } from '@storybook/react';
import { Alert, Icon, message, Tooltip } from 'antd';
import { Alert, message, Tooltip } from 'antd';
import { ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';
import MxGraphContainer, { WIDGETS_PREFIX } from '../components/mxGraph';
import ExampleContainer from './components/exampleCode';
import '../styles/index.scss';

const stories = storiesOf('mxGraph', module);
const otherDependencies =
"import { mxGraphContainer } from 'dt-react-component';\nimport ReactDOMServer from 'react-dom/server';\nimport { Icon, Tooltip } from 'antd';";
"import { mxGraphContainer } from 'dt-react-component';\nimport ReactDOMServer from 'react-dom/server';\nimport { Tooltip } from 'antd';\nimport { ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';";

stories.add('mxGraph 基础使用', () => {
return (
Expand Down Expand Up @@ -71,16 +72,10 @@ stories.add('mxGraph 基础使用', () => {
}}
>
<Tooltip title="放大">
<Icon
type="zoom-in"
onClick={() => graph.zoomIn()}
/>
<ZoomInOutlined onClick={() => graph.zoomIn()} />
</Tooltip>
<Tooltip title="缩小">
<Icon
type="zoom-out"
onClick={() => graph.zoomOut()}
/>
<ZoomOutOutlined onClick={() => graph.zoomOut()} />
</Tooltip>
</div>
)}
Expand Down Expand Up @@ -156,16 +151,10 @@ stories.add('mxGraph 基础使用', () => {
}}
>
<Tooltip title="放大">
<Icon
type="zoom-in"
onClick={() => graph.zoomIn()}
/>
<ZoomInOutlined onClick={() => graph.zoomIn()} />
</Tooltip>
<Tooltip title="缩小">
<Icon
type="zoom-out"
onClick={() => graph.zoomOut()}
/>
<ZoomOutOutlined onClick={() => graph.zoomOut()} />
</Tooltip>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17363,7 +17363,7 @@ stack-utils@^2.0.3:
dependencies:
escape-string-regexp "^2.0.0"

standard-version@^9.3.2:
standard-version@^9.5.0:
version "9.5.0"
resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-9.5.0.tgz#851d6dcddf5320d5079601832aeb185dbf497949"
integrity sha512-3zWJ/mmZQsOaO+fOlsa0+QK90pwhNd042qEcw6hKFNoLFs7peGyvPffpEBbK/DSGPbyOvli0mUIFv5A4qTjh2Q==
Expand Down

0 comments on commit 2ab9d42

Please sign in to comment.