diff --git a/components/IconFont/IconFont.js b/components/IconFont/IconFont.js deleted file mode 100755 index 5701a7b15d0cb9592d2651fc8113c422d034ff64..0000000000000000000000000000000000000000 --- a/components/IconFont/IconFont.js +++ /dev/null @@ -1,7 +0,0 @@ -import { Icon } from 'antd'; - -const IconFont = Icon.createFromIconfontCN({ - scriptUrl: '//at.alicdn.com/t/font_1509781_pkjtz0jd3g.js', -}); - -export default IconFont; diff --git a/components/IconFont/IconFont.ts b/components/IconFont/IconFont.ts new file mode 100755 index 0000000000000000000000000000000000000000..ae84020ee106440420d0d401efc8ffb9045f00c9 --- /dev/null +++ b/components/IconFont/IconFont.ts @@ -0,0 +1,7 @@ +import { createFromIconfontCN } from '@ant-design/icons'; + +const IconFont = createFromIconfontCN({ + scriptUrl: '//at.alicdn.com/t/font_1509781_7snuvbtppnq.js', +}); + +export default IconFont; diff --git a/components/IconFont/index.js b/components/IconFont/index.js deleted file mode 100644 index b675246342b500642114591efb626ad1c6328a98..0000000000000000000000000000000000000000 --- a/components/IconFont/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; -import { Icon } from 'antd'; -import IconFont from './IconFont'; -import styles from './styles.less'; - -const CustomIcon = props => { - const { type, iconFontType } = props; - const isHttp = /^((https|http)?:\/\/)[^\s]+/.test(type); - if (iconFontType) { - return - } - return isHttp ? icon : - -}; -export default CustomIcon \ No newline at end of file diff --git a/components/IconFont/index.tsx b/components/IconFont/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..85a6ffc73ae11dee94b074a28f9c04473b02c0b5 --- /dev/null +++ b/components/IconFont/index.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import IconFont from './IconFont'; +import styles from './styles.less'; + +interface IProps { + type?: string; + src?: string; +} +const CustomIcon = (props:IProps) => { + const { type, src } = props; + const isHttp = /^((https|http)?:\/\/)[^\s]+/.test(src || ''); + if (type) { + return ; + } if (src && isHttp) { + return icon; + } + return null; +}; +export default CustomIcon;