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

Update the names of some icons and add a new category for token icons #443

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lazy-dolls-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ant-design/web3-icons': patch
---

fix: Fix the correct name for the Cronos icon, update the name for the token, and add a new token icons category.
13 changes: 11 additions & 2 deletions .dumi/theme/builtins/IconSearch/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,37 @@ const chain = [
'Polygon',
'Sui',
'Tron',
'USDT',
'Base',
'Avalanche',
'Fantom',
'Celo',
'Cronos',
'Moonbeam',
'Solana',
];

const token = ['DAI', 'WBTC', 'AAVE', 'USDT'];

const tool = [
'CoinbaseWallet',
'Etherscan',
'MetaMask',
'WalletConnect',
'TokenPocket',
'Safeheron',
'Uniswap',
'PancakeSwap',
'SushiSwap',
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

Due to duplicate IDs, when multiple icons are present on the page, there may be display issues.

You can fix it like: #346

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestion. The issue has been fixed.
image

'Phantom',
];

const datum = [...chain, ...tool];
const datum = [...chain, ...token, ...tool];

const other = all.filter((n) => !datum.includes(n));

export const categories = {
chain,
token,
tool,
other,
};
Expand Down
1 change: 1 addition & 0 deletions .dumi/theme/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"app.docs.components.icon.filled": "Filled",
"app.docs.components.icon.circle-filled": "Circle Filled",
"app.docs.components.icon.category.chain": "Chain Icons",
"app.docs.components.icon.category.token": "Token Icons",
"app.docs.components.icon.category.tool": "Tool Icons",
"app.docs.components.icon.category.other": "Other Icons",

Expand Down
1 change: 1 addition & 0 deletions .dumi/theme/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"app.docs.components.icon.filled": "单色风格",
"app.docs.components.icon.circle-filled": "圆底单色",
"app.docs.components.icon.category.chain": "链图标",
"app.docs.components.icon.category.token": "代币图标",
"app.docs.components.icon.category.tool": "工具图标",
"app.docs.components.icon.category.other": "其他图标",

Expand Down
280 changes: 96 additions & 184 deletions packages/icons/src/__tests__/__snapshots__/index.test.tsx.snap

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/icons/src/components/aave-circle-colorful.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type IconBaseProps } from '@ant-design/icons/lib/components/Icon';
import classnames from 'classnames';
import { ConfigProvider } from 'antd';

export const AaveCircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
export const AAVECircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('web3-icon-aave-circle-colorful');
return (
Expand All @@ -17,4 +17,4 @@ export const AaveCircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProp
/>
);
});
AaveCircleColorful.displayName = 'AaveCircleColorful';
AAVECircleColorful.displayName = 'AAVECircleColorful';
22 changes: 0 additions & 22 deletions packages/icons/src/components/cronos-circle-colorful.tsx

This file was deleted.

20 changes: 20 additions & 0 deletions packages/icons/src/components/cronos-colorful.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from 'react';
import AntdIcon from '@ant-design/icons';
import SVGComponent from '../svgs/cronos-colorful.svg';
import { type IconBaseProps } from '@ant-design/icons/lib/components/Icon';
import classnames from 'classnames';
import { ConfigProvider } from 'antd';

export const CronosColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('web3-icon-cronos-colorful');
return (
<AntdIcon
{...props}
className={classnames(prefixCls, props.className)}
ref={ref}
component={SVGComponent}
/>
);
});
CronosColorful.displayName = 'CronosColorful';
4 changes: 2 additions & 2 deletions packages/icons/src/components/dai-circle-colorful.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type IconBaseProps } from '@ant-design/icons/lib/components/Icon';
import classnames from 'classnames';
import { ConfigProvider } from 'antd';

export const DaiCircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
export const DAICircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('web3-icon-dai-circle-colorful');
return (
Expand All @@ -17,4 +17,4 @@ export const DaiCircleColorful = React.forwardRef<HTMLSpanElement, IconBaseProps
/>
);
});
DaiCircleColorful.displayName = 'DaiCircleColorful';
DAICircleColorful.displayName = 'DAICircleColorful';
4 changes: 2 additions & 2 deletions packages/icons/src/components/usdt-colorful.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type IconBaseProps } from '@ant-design/icons/lib/components/Icon';
import classnames from 'classnames';
import { ConfigProvider } from 'antd';

export const UsdtColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
export const USDTColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((props, ref) => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('web3-icon-usdt-colorful');
return (
Expand All @@ -17,4 +17,4 @@ export const UsdtColorful = React.forwardRef<HTMLSpanElement, IconBaseProps>((pr
/>
);
});
UsdtColorful.displayName = 'UsdtColorful';
USDTColorful.displayName = 'USDTColorful';
2 changes: 1 addition & 1 deletion packages/icons/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export * from './components/chrome-circle-colorful';

export * from './components/tokenpocket-colorful';

export * from './components/cronos-circle-colorful';
export * from './components/cronos-colorful';
export * from './components/wbtc-circle-colorful';
export * from './components/dai-circle-colorful';
export * from './components/uniswap-colorful';
Expand Down
15 changes: 7 additions & 8 deletions packages/icons/src/svgs/aave-circle-colorful.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/icons/src/svgs/avalanche-circle-colorful.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/icons/src/svgs/base-circle-colorful.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 0 additions & 23 deletions packages/icons/src/svgs/cronos-circle-colorful.svg

This file was deleted.

23 changes: 23 additions & 0 deletions packages/icons/src/svgs/cronos-colorful.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/icons/src/svgs/fantom-circle-colorful.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading