-
Notifications
You must be signed in to change notification settings - Fork 25
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
Use new brand icons #348
Comments
Icon library available here for testing: Tried to implement svg icons about this way on the app, but failed. More React/Webpack skill needed. |
Oh, and if we use svg-sprite we need polyfill for some browsers https://github.com/jonathantneal/svg4everybody |
This is the minimal solution, but I don't know how to get the url of asset loaded from npm modules in react/webpack: |
Since import TicketImage from 'hel-icons/dist/ticket.svg'; // or wherever
const TicketImageElement = () => <img src={TicketImage} />; |
I think I tried that, but current loader configuration returns base64 encoded svg data instead of url to the file. (I have to recheck, but I THINK this is what happened when I tried) |
Yeah, that's expected and should work.
|
|
You don't really gain much by using SVG sprites here, since Anyway, there's a loader for that... |
I tried that loader already (used in the example workflow that I linked in first comment) but my webpack/react skills fail there. I didn't really get how to refer to the loaded icons. And it seems a bit overkill as our icon-library serves already optimised svg-icon-sprite package. If we use individual icons as data url, then I would need to build a component that does the import dynamically depending on component props. i.e.:
helicon.js
How to do the dynamic import? |
Webpack's context thing deals with that. I recall this is a Webpack 1 project still, so see the docs here... http://webpack.github.io/docs/context.html |
This workflow I was using as reference uses I guess I could try a simple component with an expression on |
I was thinking something like this: https://github.com/webpack-contrib/file-loader Essentially this is just one SVG file that can be referenced in multiple places or set of small files each referenced individually. Thus, two things need to happen:
File loader seems to fit these points. |
Replace icons that can be replaced with new visual style ones. Maybe even test and use the up-and-coming svg-icon library.
The text was updated successfully, but these errors were encountered: