-
-
Notifications
You must be signed in to change notification settings - Fork 999
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
Added Static class IconType for intellisense #987
Added Static class IconType for intellisense #987
Conversation
Codecov Report
@@ Coverage Diff @@
## master #987 +/- ##
=========================================
- Coverage 5.58% 5.51% -0.07%
=========================================
Files 406 408 +2
Lines 21815 22663 +848
=========================================
+ Hits 1218 1250 +32
- Misses 20597 21413 +816
Continue to review full report at Codecov.
|
Thank you for contribution @porkopek . It helps a lot. Did you make it by a generator script? Could you offer it that we can use for Icon synchronization? |
Sure. I did it with a little script just to generate the code, not the file. But if you point me where in the code you put the auto-generated files, I could write a class that generate the file automatically, so no need to synchronize it |
You can put it in the ./scripts directory. I want to generate the icon components from svg files. Like the icon components in react version. |
I've created a C# static class that generates the
Let me know if this is useful for the project or needs any changes, and if you want me to provide some tests for the logic |
Thank you @porkopek . I'm prefer to generate the icon class form https://github.com/ant-design/ant-design-icons/tree/master/packages/icons-svg/svg |
This is just to have intellisense in |
* Added Static class IconType for intellisense * Added: Static Class Generator * move the generator file to cli Co-authored-by: ElderJames <shunjiey@hotmail.com>
* Added Static class IconType for intellisense * Added: Static Class Generator * move the generator file to cli Co-authored-by: ElderJames <shunjiey@hotmail.com>
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
The
Icon Type
expects a string, not an enum, but there is no way to use this component without insert a magic string as the Type. With this static class, you don't need to remember the name of the icons, nor you can write the wrong name, besides it provides intellisense.💡 Background and solution
I made a static class to provide intellisense and type safety for icons
📝 Changelog
No breaking changes, just more convenience
☑️ Self Check before Merge