Added package for react-native SVG icons#529
Closed
ValentinaKozlova wants to merge 7 commits intomicrosoft:mainfrom
Closed
Added package for react-native SVG icons#529ValentinaKozlova wants to merge 7 commits intomicrosoft:mainfrom
ValentinaKozlova wants to merge 7 commits intomicrosoft:mainfrom
Conversation
| 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') |
Contributor
Author
There was a problem hiding this comment.
As majority of our icons contains only those tags I decided to use regex to change casing
7ac29f4 to
b4ae4dd
Compare
rurikoaraki
reviewed
Jan 10, 2023
| 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\''); |
Contributor
There was a problem hiding this comment.
Should these commented lines be removed?
Contributor
Author
There was a problem hiding this comment.
Not for now. Maybe I'll need it later. If not, I'll remove it
Contributor
|
Should a "Build React Native library" CI step be added? |
rurikoaraki
previously approved these changes
Jan 10, 2023
Contributor
Author
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 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-commonfolder.Issues with current package:
npm run build:cjsrmwhich is not suitable for RNThings to do:
Verification:
Icon generated code looks like this:
In RN tester:
