diff --git a/client/common/useKeyDownHandlers.js b/client/common/useKeyDownHandlers.js index ce57ab5925..d2e90d7997 100644 --- a/client/common/useKeyDownHandlers.js +++ b/client/common/useKeyDownHandlers.js @@ -33,7 +33,11 @@ export default function useKeyDownHandlers(keyHandlers) { const isMac = navigator.userAgent.toLowerCase().indexOf('mac') !== -1; const isCtrl = isMac ? e.metaKey : e.ctrlKey; if (e.shiftKey && isCtrl) { - handlers.current[`ctrl-shift-${e.key.toLowerCase()}`]?.(e); + handlers.current[ + `ctrl-shift-${ + /^\d+$/.test(e.code.at(-1)) ? e.code.at(-1) : e.key.toLowerCase() + }` + ]?.(e); } else if (isCtrl) { handlers.current[`ctrl-${e.key.toLowerCase()}`]?.(e); } diff --git a/client/components/AddRemoveButton.jsx b/client/components/AddRemoveButton.jsx deleted file mode 100644 index 48be8664e7..0000000000 --- a/client/components/AddRemoveButton.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { useTranslation } from 'react-i18next'; - -import AddIcon from '../images/plus.svg'; -import RemoveIcon from '../images/minus.svg'; - -const AddRemoveButton = ({ type, onClick }) => { - const { t } = useTranslation(); - const alt = - type === 'add' - ? t('AddRemoveButton.AltAddARIA') - : t('AddRemoveButton.AltRemoveARIA'); - const Icon = type === 'add' ? AddIcon : RemoveIcon; - - return ( - - ); -}; - -AddRemoveButton.propTypes = { - type: PropTypes.oneOf(['add', 'remove']).isRequired, - onClick: PropTypes.func.isRequired -}; - -export default AddRemoveButton; diff --git a/client/components/NavBasic.jsx b/client/components/NavBasic.jsx deleted file mode 100644 index 2eda24dcf6..0000000000 --- a/client/components/NavBasic.jsx +++ /dev/null @@ -1,52 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import { withTranslation } from 'react-i18next'; - -import LogoIcon from '../images/p5js-logo-small.svg'; -import ArrowIcon from '../images/triangle-arrow-left.svg'; - -class NavBasic extends React.PureComponent { - static defaultProps = { - onBack: null - }; - - render() { - return ( - - ); - } -} - -NavBasic.propTypes = { - onBack: PropTypes.func, - t: PropTypes.func.isRequired -}; - -export default withTranslation()(NavBasic); diff --git a/client/components/OverlayManager.jsx b/client/components/OverlayManager.jsx deleted file mode 100644 index 86a956a407..0000000000 --- a/client/components/OverlayManager.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { createPortal } from 'react-dom'; - -const OverlayManager = ({ overlay, hideOverlay }) => { - // const [visible, trigger, setRef] = useModalBehavior(); - - const jsx = ( - - {/*
- {visible && } -
*/} -
- ); - - return jsx && createPortal(jsx, document.body); -}; - -OverlayManager.propTypes = { - overlay: PropTypes.string, - hideOverlay: PropTypes.func.isRequired -}; - -OverlayManager.defaultProps = { overlay: null }; - -export default OverlayManager; diff --git a/client/components/PreviewNav.jsx b/client/components/PreviewNav.jsx index fa42a89427..f66476d92b 100644 --- a/client/components/PreviewNav.jsx +++ b/client/components/PreviewNav.jsx @@ -12,12 +12,14 @@ const PreviewNav = ({ owner, project }) => {