-
Notifications
You must be signed in to change notification settings - Fork 528
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 package for react-native SVG icons #529
base: main
Are you sure you want to change the base?
Conversation
@@ -132,12 +132,16 @@ function processFolder(srcPath, destPath, resizable) { | |||
var iconContent = fs.readFileSync(srcFile, { encoding: "utf8" }) | |||
|
|||
var jsxCode = resizable ? svgr.default.sync(iconContent, svgrOpts, { filePath: file }) : svgr.default.sync(iconContent, svgrOptsSizedIcons, { filePath: file }) | |||
var rnRegex = new RegExp('(<(|\/))(svg|path|rect|g)', 'g') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As majority of our icons contains only those tags I decided to use regex to change casing
7ac29f4
to
b4ae4dd
Compare
@@ -69,9 +69,9 @@ function processFiles(src, dest) { | |||
// Finally add the interface definition and then write out the index. | |||
indexContents.push('export { FluentReactNativeIconsProps } from \'./utils/FluentReactNativeIconsProps.types\''); | |||
indexContents.push('export { default as wrapIcon } from \'./utils/wrapIcon\''); | |||
indexContents.push('export { default as bundleIcon } from \'./utils/bundleIcon\''); | |||
//indexContents.push('export { default as bundleIcon } from \'./utils/bundleIcon\''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these commented lines be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now. Maybe I'll need it later. If not, I'll remove it
Should a "Build React Native library" CI step be added? |
Yes, but I thought to add it separately. Next steps can be to move duplicate code to a separate folder, check the generated icons and then build it for RN |
Added package for generation of react-native SVG icons.
1st commit contains copy of react-icons code because majority of it can be reused.
For better readability in other commits I added react-native-specific code.
This PR is for getting early feedback.
Maybe it would be good to put duplicated code in sort of
react-common
folder.Issues with current package:
npm run build:cjs
rm
which is not suitable for RNThings to do:
Verification:
Icon generated code looks like this:
In RN tester: