refactor: consolidate duplicate SVG icon components into centralized pattern - #2358
Open
MamtaKumari2006 wants to merge 2 commits into
Open
MamtaKumari2006 wants to merge 2 commits into
MamtaKumari2006 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved build, lint, snapshot, dependency, and consolidation issues remain.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (4)
What changed in this PR
This PR begins centralizing SVG icon rendering and updates site build/editor configuration.
Changes:
- Adds a shared search icon registry and renderer.
- Updates the legacy
SearchSvgwrapper. - Adjusts site scripts and VS Code JSON formatting.
| File | Summary |
|---|---|
site/package.json |
Updates site build and start scripts. |
packages/web/src/components/shared/SearchSvg.js |
Delegates search icon rendering. |
packages/web/src/components/shared/Icons.js |
Adds centralized icon rendering infrastructure. |
.vscode/settings.json |
Configures JSON formatting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| SearchSvg.propTypes = { | ||
| style: types.style, | ||
| }; | ||
| import { SearchSvg } from './icons'; |
Comment on lines
+17
to
+21
| export const ICONS_PATHS = { | ||
| search: `M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609, | ||
| 0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021, | ||
| 0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338, | ||
| 4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z`, |
Comment on lines
+31
to
+37
| <svg | ||
| alt={name} | ||
| className={`${name}-icon`} | ||
| height="12" | ||
| width="12" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 15 15" |
Comment on lines
+22
to
+24
| } | ||
|
|
||
| export const svgIcons = ({name,style, ...props}) => { |
This branch has not been deployed
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.



Proposed Changes
icons.jsregistry.SvgIconcomponent to eliminate redundant styled-wrapper and SVG boilerplate.Closes #2324
Checklist