* SVG: Add dompurify preprocessor step (#698) * add sanitized SVG component (cherry picked from commit dbbe819368f507b9493b7a3cf6e080a5dd752b3e) * Remove added file Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
co-authored by
Ryan McKinley
parent
56cb8a6ee8
commit
c9c7f0d653
@@ -57,9 +57,13 @@ export const Icon = React.forwardRef<HTMLDivElement, IconProps>(
|
||||
console.warn('Icon component passed an invalid icon name', name);
|
||||
}
|
||||
|
||||
if (!name || name.includes('..')) {
|
||||
return <div ref={ref}>invalid icon name</div>;
|
||||
}
|
||||
|
||||
const svgSize = getSvgSize(size);
|
||||
const svgHgt = svgSize;
|
||||
const svgWid = name?.startsWith('gf-bar-align') ? 16 : name?.startsWith('gf-interp') ? 30 : svgSize;
|
||||
const svgWid = name.startsWith('gf-bar-align') ? 16 : name.startsWith('gf-interp') ? 30 : svgSize;
|
||||
const subDir = getIconSubDir(name, type);
|
||||
const svgPath = `${iconRoot}${subDir}/${name}.svg`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user