From 8bf4008c51352775164143c2a897e4656dec7cf3 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Wed, 29 Apr 2020 18:34:37 -0400 Subject: [PATCH 1/4] Migrate from React-InlineSVG to SVGR --- client/components/AddRemoveButton.jsx | 17 +- client/components/Nav.jsx | 23 +- client/components/NavBasic.jsx | 9 +- client/components/PreviewNav.jsx | 9 +- client/modules/App/components/Overlay.jsx | 5 +- client/modules/IDE/components/About.jsx | 21 +- client/modules/IDE/components/AssetList.jsx | 5 +- .../CollectionList/CollectionList.jsx | 9 +- .../CollectionList/CollectionListRow.jsx | 5 +- client/modules/IDE/components/Console.jsx | 33 +- .../modules/IDE/components/CopyableInput.jsx | 5 +- .../modules/IDE/components/EditableInput.jsx | 9 +- client/modules/IDE/components/Editor.jsx | 19 +- client/modules/IDE/components/Feedback.jsx | 5 +- client/modules/IDE/components/FileNode.jsx | 17 +- .../modules/IDE/components/NewFileModal.jsx | 5 +- .../modules/IDE/components/NewFolderModal.jsx | 5 +- client/modules/IDE/components/Preferences.jsx | 11 +- .../IDE/components/QuickAddList/Icons.jsx | 11 +- .../IDE/components/Searchbar/Searchbar.jsx | 5 +- client/modules/IDE/components/Sidebar.jsx | 5 +- client/modules/IDE/components/SketchList.jsx | 13 +- client/modules/IDE/components/Toast.jsx | 5 +- client/modules/IDE/components/Toolbar.jsx | 20 +- .../IDE/components/UploadFileModal.jsx | 5 +- client/modules/User/components/APIKeyForm.jsx | 5 +- client/modules/User/components/APIKeyList.jsx | 5 +- client/modules/User/components/Collection.jsx | 17 +- .../modules/User/components/GithubButton.jsx | 5 +- .../modules/User/components/GoogleButton.jsx | 5 +- client/styles/abstracts/_mixins.scss | 4 +- client/styles/abstracts/_placeholders.scss | 25 +- client/styles/abstracts/_variables.scss | 12 +- client/styles/components/_api-key.scss | 6 +- client/styles/components/_asset-list.scss | 2 +- client/styles/components/_collection.scss | 8 +- client/styles/components/_console.scss | 6 +- client/styles/components/_editable-input.scss | 2 +- client/styles/components/_editor.scss | 10 +- client/styles/components/_nav.scss | 6 +- client/styles/components/_quick-add.scss | 22 +- client/styles/components/_searchbar.scss | 2 + client/styles/components/_sidebar.scss | 16 +- client/styles/components/_sketch-list.scss | 2 +- client/styles/components/_toolbar.scss | 17 +- package-lock.json | 1188 +++++++++++++++-- package.json | 2 +- webpack/config.dev.js | 25 +- webpack/config.prod.js | 27 +- 49 files changed, 1344 insertions(+), 351 deletions(-) diff --git a/client/components/AddRemoveButton.jsx b/client/components/AddRemoveButton.jsx index f0ec1272..7350c177 100644 --- a/client/components/AddRemoveButton.jsx +++ b/client/components/AddRemoveButton.jsx @@ -1,17 +1,20 @@ import React from 'react'; import PropTypes from 'prop-types'; -import InlineSVG from 'react-inlinesvg'; -const addIcon = require('../images/plus.svg'); -const removeIcon = require('../images/minus.svg'); +import AddIcon from '../images/plus.svg'; +import RemoveIcon from '../images/minus.svg'; const AddRemoveButton = ({ type, onClick }) => { - const alt = type === 'add' ? 'add to collection' : 'remove from collection'; - const icon = type === 'add' ? addIcon : removeIcon; + const alt = type === 'add' ? 'Add to collection' : 'Remove from collection'; + const Icon = type === 'add' ? AddIcon : RemoveIcon; return ( - ); }; diff --git a/client/components/Nav.jsx b/client/components/Nav.jsx index a34b9e46..5d9a522a 100644 --- a/client/components/Nav.jsx +++ b/client/components/Nav.jsx @@ -3,7 +3,6 @@ import React from 'react'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import { Link } from 'react-router'; -import InlineSVG from 'react-inlinesvg'; import classNames from 'classnames'; import * as IDEActions from '../modules/IDE/actions/ide'; import * as toastActions from '../modules/IDE/actions/toast'; @@ -12,10 +11,10 @@ import { setAllAccessibleOutput } from '../modules/IDE/actions/preferences'; import { logoutUser } from '../modules/User/actions'; import { metaKeyName, } from '../utils/metaKey'; -import caretLeft from '../images/left-arrow.svg'; -const triangleUrl = require('../images/down-filled-triangle.svg'); -const logoUrl = require('../images/p5js-logo-small.svg'); +import CaretLeftIcon from '../images/left-arrow.svg'; +import TriangleIcon from '../images/down-filled-triangle.svg'; +import LogoIcon from '../images/p5js-logo-small.svg'; const __process = (typeof global !== 'undefined' ? global : window).process; @@ -229,11 +228,11 @@ class Nav extends React.PureComponent { return (