diff --git a/package.json b/package.json index bd49aed5..b3191975 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,6 @@ "keywords": [], "main": "src/index.js", "dependencies": { - "@fortawesome/fontawesome-svg-core": "^1.2.26", - "@fortawesome/free-solid-svg-icons": "^5.12.0", - "@fortawesome/react-fontawesome": "^0.1.8", "lodash": "4.17.15", "react": "16.12.0", "react-dom": "16.12.0", @@ -30,12 +27,7 @@ "test": "react-scripts test --env=jsdom --passWithNoTests", "eject": "react-scripts eject" }, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ], + "browserslist": [">0.2%", "not dead", "not ie <= 11", "not op_mini all"], "eslintConfig": { "extends": "react-app" }, @@ -45,12 +37,7 @@ } }, "lint-staged": { - "*.{js,css,json,md,ts,tsx}": [ - "prettier --write", - "git add" - ], - "*.{js,ts,tsx}": [ - "eslint" - ] + "*.{js,css,json,md,ts,tsx}": ["prettier --write", "git add"], + "*.{js,ts,tsx}": ["eslint"] } } diff --git a/src/index.tsx b/src/index.tsx index f6131153..e98dff1d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,14 +2,6 @@ import React from "react"; import ReactDOM from "react-dom"; import rough from "roughjs/bin/wrappers/rough"; import { RoughCanvas } from "roughjs/bin/canvas"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { - faMousePointer, - faSquare, - faCircle, - faLongArrowAltRight, - faFont -} from "@fortawesome/free-solid-svg-icons"; import { moveOneLeft, moveAllLeft, moveOneRight, moveAllRight } from "./zindex"; @@ -733,25 +725,51 @@ const KEYS = { BACKSPACE: "Backspace" }; +// We inline font-awesome icons in order to save on js size rather than including the font awesome react library const SHAPES = [ { - icon: faMousePointer, + icon: ( + // fa-mouse-pointer + + ), value: "selection" }, { - icon: faSquare, + icon: ( + // fa-square + + ), value: "rectangle" }, { - icon: faCircle, + icon: ( + // fa-circle + + ), value: "ellipse" }, { - icon: faLongArrowAltRight, + icon: ( + // fa-long-arrow-alt-right + + ), value: "arrow" }, { - icon: faFont, + icon: ( + // fa-font + + ), value: "text" } ]; @@ -989,9 +1007,7 @@ class App extends React.Component<{}, AppState> { this.forceUpdate(); }} /> -