We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a4186d commit af3ca28Copy full SHA for af3ca28
.gitignore
@@ -1,3 +1,4 @@
1
+.DS_Store
2
/build/
3
/node_modules/
4
/public/
src/helpers/svg.js
@@ -1,10 +1,9 @@
'use strict'
-const fs = require('fs')
const path = require('path')
5
6
-module.exports = (iconName) => {
7
- const pathName = path.join(__dirname, '/src/img/', iconName + '.svg')
8
- const content = fs.readFileSync(pathName, 'utf8')
9
- return content
+module.exports = (iconName, { data }) => {
+ const uiRootPath = data.root.uiRootPath
+ const svgFilePath = path.join(uiRootPath, 'img', iconName + '.svg')
+ return '<img src="' + svgFilePath + '" alt="' + iconName + '" />'
10
}
0 commit comments