Add font-awesome icons

This commit is contained in:
Tom Russell 2018-10-01 15:20:45 +01:00
parent f2d543f3c6
commit 86e30b1012
3 changed files with 90 additions and 0 deletions

35
app/package-lock.json generated
View File

@ -161,6 +161,36 @@
}
}
},
"@fortawesome/fontawesome-common-types": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.4.tgz",
"integrity": "sha512-0qbIVm+MzkxMwKDx8V0C7w/6Nk+ZfBseOn2R1YK0f2DQP5pBcOQbu9NmaVaLzbJK6VJb1TuyTf0ZF97rc6iWJQ=="
},
"@fortawesome/fontawesome-svg-core": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.4.tgz",
"integrity": "sha512-oGtnwcdhJomoDxbJcy6S0JxK6ItDhJLNOujm+qILPqajJ2a0P/YRomzBbixFjAPquCoyPUlA9g9ejA22P7TKNA==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.4"
}
},
"@fortawesome/free-solid-svg-icons": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.3.1.tgz",
"integrity": "sha512-NkiLBFoiHtJ89cPJdM+W6cLvTVKkLh3j9t3MxkXyip0ncdD3lhCunSuzvFcrTHWeETEyoClGd8ZIWrr3HFZ3BA==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.4"
}
},
"@fortawesome/react-fontawesome": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.3.tgz",
"integrity": "sha512-tc689l67rPZ7+ynZVUgOXY80rAt5KxvuH1qjPpJcbyJzJHzk5yhrD993BjsSEdPBLTtPqmvwynsO/XrAQqHbtg==",
"requires": {
"humps": "^2.0.1",
"prop-types": "^15.5.10"
}
},
"@mapbox/sphericalmercator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@mapbox/sphericalmercator/-/sphericalmercator-1.1.0.tgz",
@ -5551,6 +5581,11 @@
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
"integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM="
},
"humps": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/humps/-/humps-2.0.1.tgz",
"integrity": "sha1-3QLqYIG9BWjcXQcxhEY5V7qe+ao="
},
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",

View File

@ -11,6 +11,9 @@
"start:prod": "NODE_ENV=production node build/server.js"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.4",
"@fortawesome/free-solid-svg-icons": "^5.3.1",
"@fortawesome/react-fontawesome": "^0.1.3",
"@mapbox/sphericalmercator": "^1.1.0",
"body-parser": "^1.18.3",
"bootstrap": "^4.1.3",

52
app/src/frontend/icons.js Normal file
View File

@ -0,0 +1,52 @@
/**
* Mini-library of icons
*/
import React from 'react'
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faQuestionCircle, faPaintBrush, faInfoCircle, faTimes, faCheck, faAngleLeft, faCaretDown } from '@fortawesome/free-solid-svg-icons'
library.add(
faQuestionCircle,
faInfoCircle,
faPaintBrush,
faTimes,
faCheck,
faCheckDouble,
faAngleLeft,
faCaretDown
);
const HelpIcon = () => (
<FontAwesomeIcon icon="question-circle" />
);
const InfoIcon = () => (
<FontAwesomeIcon icon="info-circle" />
);
const EditIcon = () => (
<FontAwesomeIcon icon="paint-brush" />
);
const CloseIcon = () => (
<FontAwesomeIcon icon="times" />
);
const SaveIcon = () => (
<FontAwesomeIcon icon="check" />
);
const SaveDoneIcon = () => (
<FontAwesomeIcon icon="check-double" />
);
const BackIcon = () => (
<FontAwesomeIcon icon="angle-left" />
)
const DownIcon = () => (
<FontAwesomeIcon icon="caret-down" />
)
export { HelpIcon, InfoIcon, EditIcon, CloseIcon, SaveIcon, SaveDoneIcon, BackIcon, DownIcon };