File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
packages/sui-svg/templates Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,16 @@ const template = content => {
2
2
return `import {memo} from 'react'
3
3
import AtomIcon from '@s-ui/react-atom-icon'
4
4
5
- const MemoAtomIcon = memo(({id, title, ...props}) => {
6
- const injectAccessibility = ({id, svg, title}) => {
7
- if (!title || !id) return svg.replace(/<svg([^>]*)>/, '<svg$1 aria-hidden="true">')
5
+ const injectAccessibility = ({id, svg, title}) => {
6
+ if (!title || !id) return svg.replace(/<svg([^>]*)>/, '<svg$1 aria-hidden="true">')
8
7
9
- return svg.replace(
10
- /<svg([^>]*)>/,
11
- \`<svg$1 role="img" aria-labelledby="\${id}"><title id="\${id}">\${title}</title>\`
12
- )
13
- }
8
+ return svg.replace(
9
+ /<svg([^>]*)>/,
10
+ \`<svg$1 role="img" aria-labelledby="\${id}"><title id="\${id}">\${title}</title>\`
11
+ )
12
+ }
14
13
14
+ const MemoAtomIcon = memo(({id, title, ...props}) => {
15
15
const safeContent = injectAccessibility({id, svg: \`${ content } \`, title})
16
16
17
17
return (
You can’t perform that action at this time.
0 commit comments