-
Notifications
You must be signed in to change notification settings - Fork 435
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
Tech improvement: Refactor direct embedding of SVGs #1058
Comments
@ShubhamPalriwala @Traxmaxx wdyt? |
Hey transferring SVGs to the public folder and using Next/image to serve them might not be necessary because Next/image does not optimize SVGs. You can find more information about this in the Next.js documentation here: https://nextjs.org/docs/pages/api-reference/components/image#dangerouslyallowsvg |
the current way the SVGs are rendered are also not optimised, the next js documentation means compression as optimization. |
I just added #1080 shall I merge these two issues and update the desciption? It's good to get startet on it. edit: I have no particular opinion if we want to load them via public paths or as react components as long as icons do not need to be animated at some point. In this case it's better to have them as react components. It also makes overriding styles with tailwind easier maybe 🤔 |
Description from the other issue just for reference:
|
please assign me |
Sorry @rafiya2003 I just saw this now. All yours |
Is your feature request related to a problem? Please describe.
Could be better if we can refactor the frontend components/pages to use SVGs from the public folder rather than hardcoding the SVGs as inline embeddings
Describe the solution you'd like
Use
next/image
to serve the SVGs instead of using inlines. We could even use a library likesvgr
https://github.com/gregberge/svgr to do this. Would like to analyze.Additional context
Reference:
komiser/dashboard/components/dashboard/components/top-stats/DashboardTopStatsCards.tsx
Line 21 in 3356762
Am i willing to submit a PR ?
YES
The text was updated successfully, but these errors were encountered: