Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support more icons #738

Merged
merged 4 commits into from
Apr 19, 2024
Merged

feat: support more icons #738

merged 4 commits into from
Apr 19, 2024

Conversation

thinkasany
Copy link
Collaborator

@thinkasany thinkasany commented Mar 29, 2024

我们迎来了很多新的icon 🎉

Copy link

vercel bot commented Mar 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 8:56am

Copy link

changeset-bot bot commented Mar 29, 2024

🦋 Changeset detected

Latest commit: 948064d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@ant-design/web3-icons Minor
@ant-design/web3-assets Patch
@ant-design/web3 Patch
@ant-design/web3-ethers Patch
@ant-design/web3-solana Patch
@ant-design/web3-wagmi Patch
@example/ethers-v5 Patch
@example/ethers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@thinkasany thinkasany marked this pull request as draft March 29, 2024 03:03
Copy link

github-actions bot commented Mar 29, 2024

Preview is ready

@LCJove
Copy link
Collaborator

LCJove commented Mar 29, 2024

可以在配置中加一个这个:

 extraBabelPlugins: [['inline-react-svg', {
    svgo: {
      plugin: {
        name: 'preset-default',
        params: {
          overrides: {
            removeViewBox: false,
          },
        },
      },
    }
  }], 'react-inline-svg-unique-id'],

试一试看

@thinkasany
Copy link
Collaborator Author

可以在配置中加一个这个:

 extraBabelPlugins: [['inline-react-svg', {
    svgo: {
      plugin: {
        name: 'preset-default',
        params: {
          overrides: {
            removeViewBox: false,
          },
        },
      },
    }
  }], 'react-inline-svg-unique-id'],

试一试看

这个我尝试过了不行,svgo并不是我们直接依赖的,我猜测是不是antd-icon那边导致的,所以只能尝试修改svg格式了?

@LCJove
Copy link
Collaborator

LCJove commented Mar 29, 2024

再加一个删height和width的配置看看?我用了这个配置在本地是好的了

extraBabelPlugins: [['inline-react-svg', {
    svgo: {
      plugins: [{
        name: 'preset-default',
        params: {
          overrides: {
            removeViewBox: false,
          },
        },
      }, "removeDimensions"]
    }
  }], 'react-inline-svg-unique-id'],

我看inline-react-svg这个是会用到svgo的配置
另外我发现直接修改svg页面不会主动刷新,还是要去tsx那边保存才刷新,搞得我以为修改没用😢

@LCJove
Copy link
Collaborator

LCJove commented Mar 29, 2024

我还发现了一些icon不展示的原因是它们把 fill 写到了 style 里面,导致引用的时候丢失了这部分的颜色
需要把 fill 从 style 里面拿出来

svgo: {
      plugins: [{
        name: 'preset-default',
        params: {
          overrides: {
            removeViewBox: false,
          },
        },
      }, "removeDimensions", "convertStyleToAttrs"]
    }

可以用这个 convertStyleToAttrs 把 fill 拎出来

@thinkasany
Copy link
Collaborator Author

再加一个删height和width的配置看看?我用了这个配置在本地是好的了

extraBabelPlugins: [['inline-react-svg', {
    svgo: {
      plugins: [{
        name: 'preset-default',
        params: {
          overrides: {
            removeViewBox: false,
          },
        },
      }, "removeDimensions"]
    }
  }], 'react-inline-svg-unique-id'],

我看inline-react-svg这个是会用到svgo的配置 另外我发现直接修改svg页面不会主动刷新,还是要去tsx那边保存才刷新,搞得我以为修改没用😢

噢噢 那我可能也是没去tsx保存刷新,所以改动看不出来

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1c05b0c) to head (6fed314).
Report is 1 commits behind head on main.

❗ Current head 6fed314 differs from pull request most recent head 948064d. Consider uploading reports for the commit 948064d to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #738     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files          666       684     +18     
  Lines        20264     18483   -1781     
  Branches      1155      1137     -18     
===========================================
- Hits         20264     18483   -1781     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thinkasany thinkasany marked this pull request as ready for review March 29, 2024 09:17

import SVGComponent from '../svgs/dot-circle-colorful.svg';

export const DotCircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个组件的效果好像不符合命名:
screenshot-4nyB6xeM@2x
screenshot-LyagBl0d@2x

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

意思是改成DOT是嘛
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我想表达的是如果被命名为 XxxCircleColorful,那么这个图标的外层应该是一个完整的圆形为包裹,但 dot 的不符合


import SVGComponent from '../svgs/near-circle-filled.svg';

export const NearCircleFilled = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenshot-IU5kYA40@2x
screenshot-KsCj6icb@2x

near 的大小也有点怪,这两张图是同比例尺的

@thinkasany thinkasany marked this pull request as draft March 29, 2024 09:25

import SVGComponent from '../svgs/shib-circle-colorful.svg';

export const ShibCircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shib 的 circle colorful 和 circle filled 好像不符合规则,不行就直接去掉,保留 colorful

@jeasonstudio
Copy link
Collaborator

还有许多 icon 的 circle colorfull 和 circle filled 的展示大小不一样,这个可能要请设计师帮忙看看 @文卿

@yutingzhao1991
Copy link
Collaborator

这个还是 draft 吗?是不是可以合并了?

@yutingzhao1991
Copy link
Collaborator

样式不对的可以找文卿帮忙调整下,或者先去掉,推进下这个 PR 继续~

@thinkasany
Copy link
Collaborator Author

样式不对的可以找文卿帮忙调整下,或者先去掉,推进下这个 PR 继续~

我之前开发了一个generate脚本,我重新刷一下目录,然后和设计沟通一下进度,推进一下

@jeasonstudio jeasonstudio merged commit 7fbf83a into ant-design:main Apr 19, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants