Created
August 29, 2019 18:14
-
-
Save dosentmatter/f94a7c7cf73fa1ac30fd32790889bdaf to your computer and use it in GitHub Desktop.
`antd` `@ant-design/icons` cherry-pick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Affix | |
// Alert | |
export { default as CheckCircleOutline } from '@ant-design/icons/lib/outline/CheckCircleOutline'; | |
export { default as CloseCircleOutline } from '@ant-design/icons/lib/outline/CloseCircleOutline'; | |
export { default as CloseOutline } from '@ant-design/icons/lib/outline/CloseOutline'; | |
export { default as ExclamationCircleOutline } from '@ant-design/icons/lib/outline/ExclamationCircleOutline'; | |
export { default as InfoCircleOutline } from '@ant-design/icons/lib/outline/InfoCircleOutline'; | |
// Avatar | |
// Button | |
export { default as LoadingOutline } from '@ant-design/icons/lib/outline/LoadingOutline'; | |
// Card | |
// Col | |
// Dropdown | |
export { default as EllipsisOutline } from '@ant-design/icons/lib/outline/EllipsisOutline'; | |
export { default as RightOutline } from '@ant-design/icons/lib/outline/RightOutline'; | |
// Icon | |
// Input | |
// Layout | |
export { default as BarsOutline } from '@ant-design/icons/lib/outline/BarsOutline'; | |
export { default as LeftOutline } from '@ant-design/icons/lib/outline/LeftOutline'; | |
// export { default as RightOutline } from '@ant-design/icons/lib/outline/RightOutline'; | |
// List | |
// Menu | |
// Modal | |
// export { default as InfoCircleOutline } from '@ant-design/icons/lib/outline/InfoCircleOutline'; | |
// export { default as CheckCircleOutline } from '@ant-design/icons/lib/outline/CheckCircleOutline'; | |
// export { default as CloseCircleOutline } from '@ant-design/icons/lib/outline/CloseCircleOutline'; | |
// export { default as ExclamationCircleOutline } from '@ant-design/icons/lib/outline/ExclamationCircleOutline'; | |
// export { default as CloseOutline } from '@ant-design/icons/lib/outline/CloseOutline'; | |
// Row | |
// Tooltip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@aprilandjan, you're welcome. I'm glad you were able to find it useful.
If I remember correctly, I dug through
[email protected]
source code to find icons that were used by searching for<Icon type="..." />
. It's not ideal because you have to look through their code and trace their code paths, but it should be thorough. I either might have missed something orantd
team might have added some new icons in the latest[email protected]
.Here are some examples of
<Icon type="..." />
I used to determine what to cherry-pick:https://github.com/ant-design/ant-design/blob/3.20.3/components/modal/Modal.tsx#L217
https://github.com/ant-design/ant-design/blob/3.20.3/components/modal/index.tsx#L12-L42
I think
type="close"
becomesCloseOutline
,type="exclamation-circle"
becomesExclamationCircleOutline
,type="close-circle"
becomesCloseCircleOutline
.Some of them set
type={icon}
to a variable so you have to trace the variable:https://github.com/ant-design/ant-design/blob/3.20.3/components/modal/confirm.tsx#L76
You can see above that
icon
defaults toiconType
(deprecated), which defaults to'question-circle'
:https://github.com/ant-design/ant-design/blob/3.20.3/components/modal/confirm.tsx#L32-L41
They both can be set from
props
inprops.icon
andprops.iconType
. Since it accepts icons fromprops
, you can have additional icons. I would have cherry-picked the additional icons in my custom./components/modal
modules, since they are not required byantd
code itself.So another possibility is that
antd
doesn't require the icons you listed above, but you are feeding it in through the iconprops
.