Last active
June 7, 2021 17:33
-
-
Save ahobson/f748022ccd65753aa652fe6c5018a750 to your computer and use it in GitHub Desktop.
This file contains 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
import accessabilityNewSprite from 'uswds/src/img/sprite.svg#accessibility_new' | |
export const icons = { | |
accessibilityNew: accessabilityNewSprite, | |
} |
This file contains 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
// not sure if this is needed eslint-disable-next-line security/detect-object-injection | |
const iconSvg = icons[name] | |
return ( | |
<> | |
<svg | |
data-testid="iconComponent" | |
className={classes} | |
focusable={focusable} | |
role={role} | |
{...iconProps}> | |
<use href={iconSvg}></use> | |
</svg> | |
</> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment