diff --git a/client/components/Dropdown.jsx b/client/components/Dropdown.jsx index 0cd29574ec..179fc65294 100644 --- a/client/components/Dropdown.jsx +++ b/client/components/Dropdown.jsx @@ -1,10 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Link } from 'react-router'; import styled from 'styled-components'; -import { remSize, prop, common } from '../theme'; +import { remSize, prop } from '../theme'; import IconButton from './mobile/IconButton'; -import Button from '../common/Button'; const DropdownWrapper = styled.ul` background-color: ${prop('Modal.background')}; diff --git a/client/components/mobile/Explorer.jsx b/client/components/mobile/Explorer.jsx index f4d501ceb0..4873e23708 100644 --- a/client/components/mobile/Explorer.jsx +++ b/client/components/mobile/Explorer.jsx @@ -1,6 +1,5 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styled from 'styled-components'; import PropTypes from 'prop-types'; import Sidebar from './Sidebar'; import ConnectedFileNode from '../../modules/IDE/components/FileNode'; diff --git a/client/components/mobile/Footer.jsx b/client/components/mobile/Footer.jsx index ff19eee14d..4488b9e962 100644 --- a/client/components/mobile/Footer.jsx +++ b/client/components/mobile/Footer.jsx @@ -1,6 +1,5 @@ -import React from 'react'; import styled from 'styled-components'; -import { prop, grays } from '../../theme'; +import { prop } from '../../theme'; const background = prop('MobilePanel.default.background'); diff --git a/client/components/mobile/IDEWrapper.jsx b/client/components/mobile/IDEWrapper.jsx index 5e66ee0186..429c39b5b5 100644 --- a/client/components/mobile/IDEWrapper.jsx +++ b/client/components/mobile/IDEWrapper.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import styled from 'styled-components'; import { remSize } from '../../theme'; diff --git a/client/components/mobile/Sidebar.jsx b/client/components/mobile/Sidebar.jsx index 7ae608cc69..a524dc3c47 100644 --- a/client/components/mobile/Sidebar.jsx +++ b/client/components/mobile/Sidebar.jsx @@ -1,8 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Link } from 'react-router'; import styled from 'styled-components'; -import { remSize, prop, common } from '../../theme'; +import { remSize, prop, } from '../../theme'; import Header from './Header'; import IconButton from './IconButton'; import { ExitIcon } from '../../common/icons'; diff --git a/client/components/mobile/Tab.jsx b/client/components/mobile/Tab.jsx index 20a158b476..42d086bc78 100644 --- a/client/components/mobile/Tab.jsx +++ b/client/components/mobile/Tab.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import styled from 'styled-components'; import { Link } from 'react-router'; import { prop, remSize } from '../../theme'; diff --git a/client/components/mobile/TabSwitcher.jsx b/client/components/mobile/TabSwitcher.jsx index 15a3bb0e6c..e41182e850 100644 --- a/client/components/mobile/TabSwitcher.jsx +++ b/client/components/mobile/TabSwitcher.jsx @@ -1,7 +1,6 @@ -import React from 'react'; import styled from 'styled-components'; -import { prop, remSize } from '../../theme'; +import { prop, } from '../../theme'; export default styled.div` display: flex; diff --git a/client/i18n.js b/client/i18n.js index 819fd34160..217e10fd32 100644 --- a/client/i18n.js +++ b/client/i18n.js @@ -1,6 +1,5 @@ import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; -import LanguageDetector from 'i18next-browser-languagedetector'; import Backend from 'i18next-http-backend'; import { enUS, es, ja } from 'date-fns/locale'; diff --git a/client/index.jsx b/client/index.jsx index bf8c22636c..8295e584e8 100644 --- a/client/index.jsx +++ b/client/index.jsx @@ -8,7 +8,6 @@ import configureStore from './store'; import routes from './routes'; import ThemeProvider from './modules/App/components/ThemeProvider'; import Loader from './modules/App/components/loader'; -import i18n from './i18n'; require('./styles/main.scss'); diff --git a/client/modules/App/components/Overlay.jsx b/client/modules/App/components/Overlay.jsx index 3ebeca4522..3400306ea4 100644 --- a/client/modules/App/components/Overlay.jsx +++ b/client/modules/App/components/Overlay.jsx @@ -81,7 +81,11 @@ class Overlay extends React.Component {

{title}

{actions} -
diff --git a/client/modules/IDE/components/CollectionList/CollectionList.jsx b/client/modules/IDE/components/CollectionList/CollectionList.jsx index bd1f30e10e..16c023608d 100644 --- a/client/modules/IDE/components/CollectionList/CollectionList.jsx +++ b/client/modules/IDE/components/CollectionList/CollectionList.jsx @@ -117,10 +117,18 @@ class CollectionList extends React.Component { > {displayName} {field === fieldName && direction === SortingActions.DIRECTION.ASC && - + } {field === fieldName && direction === SortingActions.DIRECTION.DESC && - + } @@ -144,9 +152,27 @@ class CollectionList extends React.Component { {this._renderFieldHeader('name', this.props.t('CollectionList.HeaderName'))} - {this._renderFieldHeader('createdAt', this.props.t('CollectionList.HeaderCreatedAt', { context: mobile ? 'mobile' : '' }))} - {this._renderFieldHeader('updatedAt', this.props.t('CollectionList.HeaderUpdatedAt', { context: mobile ? 'mobile' : '' }))} - {this._renderFieldHeader('numItems', this.props.t('CollectionList.HeaderNumItems', { context: mobile ? 'mobile' : '' }))} + {this._renderFieldHeader( + 'createdAt', + this.props.t( + 'CollectionList.HeaderCreatedAt', + { context: mobile ? 'mobile' : '' } + ) + )} + {this._renderFieldHeader( + 'updatedAt', + this.props.t( + 'CollectionList.HeaderUpdatedAt', + { context: mobile ? 'mobile' : '' } + ) + )} + {this._renderFieldHeader( + 'numItems', + this.props.t( + 'CollectionList.HeaderNumItems', + { context: mobile ? 'mobile' : '' } + ) + )} diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index 6fa79fd236..6151379c1b 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -124,7 +124,6 @@ class Editor extends React.Component { delete this._cm.options.lint.options.errors; - const replaceCommand = metaKey === 'Ctrl' ? `${metaKey}-H` : `${metaKey}-Option-F`; this._cm.setOption('extraKeys', { Tab: (cm) => { // might need to specify and indent more? @@ -156,7 +155,10 @@ class Editor extends React.Component { }, 1000)); this._cm.on('keyup', () => { - const temp = this.props.t('Editor.KeyUpLineNumber', { lineNumber: parseInt((this._cm.getCursor().line) + 1, 10) }); + const temp = this.props.t( + 'Editor.KeyUpLineNumber', + { lineNumber: parseInt((this._cm.getCursor().line) + 1, 10) } + ); document.getElementById('current-line').innerHTML = temp; }); @@ -361,7 +363,11 @@ class Editor extends React.Component { {this.props.file.name} {this.props.unsavedChanges ? - : + : null} diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx index f4b8166d31..267af6418a 100644 --- a/client/modules/IDE/components/FileNode.jsx +++ b/client/modules/IDE/components/FileNode.jsx @@ -223,7 +223,12 @@ class FileNode extends React.Component { renderChild = childId => (
  • - +
  • ) diff --git a/client/modules/IDE/components/KeyboardShortcutModal.jsx b/client/modules/IDE/components/KeyboardShortcutModal.jsx index 8977e4290f..350c2da5e2 100644 --- a/client/modules/IDE/components/KeyboardShortcutModal.jsx +++ b/client/modules/IDE/components/KeyboardShortcutModal.jsx @@ -9,7 +9,10 @@ function KeyboardShortcutModal() {

    {t('KeyboardShortcuts.CodeEditing.CodeEditing')}

    - {t('KeyboardShortcuts.ShortcutsFollow')} {t('KeyboardShortcuts.SublimeText')}. + {t('KeyboardShortcuts.ShortcutsFollow')} + + {t('KeyboardShortcuts.SublimeText')} + .

    • diff --git a/client/modules/IDE/components/Preferences/index.jsx b/client/modules/IDE/components/Preferences/index.jsx index b5998f5206..01b4965f3b 100644 --- a/client/modules/IDE/components/Preferences/index.jsx +++ b/client/modules/IDE/components/Preferences/index.jsx @@ -117,7 +117,9 @@ class Preferences extends React.Component { value="light" checked={this.props.theme === 'light'} /> - + this.props.setTheme('dark')} @@ -128,7 +130,9 @@ class Preferences extends React.Component { value="dark" checked={this.props.theme === 'dark'} /> - + this.props.setTheme('contrast')} @@ -139,7 +143,9 @@ class Preferences extends React.Component { value="contrast" checked={this.props.theme === 'contrast'} /> - +
    @@ -215,7 +221,9 @@ class Preferences extends React.Component { value="On" checked={this.props.autocloseBracketsQuotes} /> - + this.props.setAutocloseBracketsQuotes(false)} @@ -226,7 +234,9 @@ class Preferences extends React.Component { value="Off" checked={!this.props.autocloseBracketsQuotes} /> - +
    @@ -282,7 +292,9 @@ class Preferences extends React.Component { value="Off" checked={!this.props.lineNumbers} /> - +
    @@ -309,7 +321,9 @@ class Preferences extends React.Component { value="Off" checked={!this.props.lintWarning} /> - +
    diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index 7bd8bacc8a..38503a0b6c 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -8,7 +8,6 @@ import loopProtect from 'loop-protect'; import { JSHINT } from 'jshint'; import decomment from 'decomment'; import classNames from 'classnames'; -import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Decode } from 'console-feed'; import { getBlobUrl } from '../actions/files'; diff --git a/client/modules/IDE/components/SketchList.jsx b/client/modules/IDE/components/SketchList.jsx index 6abdd79020..5688e0155f 100644 --- a/client/modules/IDE/components/SketchList.jsx +++ b/client/modules/IDE/components/SketchList.jsx @@ -415,7 +415,11 @@ class SketchList extends React.Component { } {field === fieldName && direction === SortingActions.DIRECTION.DESC && - + } @@ -437,8 +441,20 @@ class SketchList extends React.Component { {this._renderFieldHeader('name', this.props.t('SketchList.HeaderName'))} - {this._renderFieldHeader('createdAt', this.props.t('SketchList.HeaderCreatedAt', { context: mobile ? 'mobile' : '' }))} - {this._renderFieldHeader('updatedAt', this.props.t('SketchList.HeaderUpdatedAt', { context: mobile ? 'mobile' : '' }))} + {this._renderFieldHeader( + 'createdAt', + this.props.t( + 'SketchList.HeaderCreatedAt', + { context: mobile ? 'mobile' : '' } + ) + )} + {this._renderFieldHeader( + 'updatedAt', + this.props.t( + 'SketchList.HeaderUpdatedAt', + { context: mobile ? 'mobile' : '' } + ) + )} diff --git a/client/modules/IDE/pages/MobileIDEView.jsx b/client/modules/IDE/pages/MobileIDEView.jsx index 0d58887e04..ca63932ae1 100644 --- a/client/modules/IDE/pages/MobileIDEView.jsx +++ b/client/modules/IDE/pages/MobileIDEView.jsx @@ -147,7 +147,7 @@ const handleGlobalKeydown = (props, cmController) => (e) => { const autosave = (autosaveInterval, setAutosaveInterval) => (props, prevProps) => { const { - autosaveProject, preferences, ide, selectedFile: file, project, isUserOwner + autosaveProject, preferences, ide, selectedFile: file, project, } = props; const { selectedFile: oldFile } = prevProps; @@ -241,7 +241,10 @@ const MobileIDEView = (props) => { const projectActions = [{ - icon: TerminalIcon, aria: 'Toggle console open/closed', action: consoleIsExpanded ? collapseConsole : expandConsole, inverted: true + icon: TerminalIcon, + aria: 'Toggle console open/closed', + action: consoleIsExpanded ? collapseConsole : expandConsole, + inverted: true }, { icon: SaveIcon, aria: 'Save project', action: () => saveProject(cmController.getContent(), false, true) }, { icon: FolderIcon, aria: 'Open files explorer', action: toggleExplorer } diff --git a/client/modules/Mobile/MobileDashboardView.jsx b/client/modules/Mobile/MobileDashboardView.jsx index 51f074fb9a..b607c8d64e 100644 --- a/client/modules/Mobile/MobileDashboardView.jsx +++ b/client/modules/Mobile/MobileDashboardView.jsx @@ -16,12 +16,10 @@ import CollectionList from '../IDE/components/CollectionList'; import AssetList from '../IDE/components/AssetList'; import Content from './MobileViewContent'; import { SketchSearchbar, CollectionSearchbar } from '../IDE/components/Searchbar'; -import Button from '../../common/Button'; import useAsModal from '../../components/useAsModal'; import Dropdown from '../../components/Dropdown'; import FooterTabSwitcher from '../../components/mobile/TabSwitcher'; import FooterTab from '../../components/mobile/Tab'; -import Loader from '../App/components/loader'; const EXAMPLE_USERNAME = 'p5'; @@ -127,10 +125,6 @@ const Subheader = styled.div` .searchbar__input { width: 100%; } `; -const SubheaderButton = styled(Button)` - border-radius: 0px !important; -`; - const Panels = { sketches: SketchList, collections: CollectionList, @@ -157,9 +151,6 @@ const NavItem = styled.li` position: relative; `; - -const isOwner = (user, params) => user && params && user.username === params.username; - const renderPanel = (name, props) => (Component => (Component && ))(Panels[name]); const MobileDashboard = ({ params, location }) => { @@ -216,7 +207,9 @@ const MobileDashboard = ({ params, location }) => { selected={tab === panel} to={pathname.replace(panel, tab)} > -

    {(isExamples && tab === 'Sketches') ? t('MobileDashboardView.Examples') : (TabLabels[tab] || tab)}

    +

    {(isExamples && tab === 'Sketches') ? + t('MobileDashboardView.Examples') : (TabLabels[tab] || tab)} +

    )) } diff --git a/client/modules/Mobile/MobilePreferences.jsx b/client/modules/Mobile/MobilePreferences.jsx index 07701e2684..074fc3d838 100644 --- a/client/modules/Mobile/MobilePreferences.jsx +++ b/client/modules/Mobile/MobilePreferences.jsx @@ -1,10 +1,9 @@ import React from 'react'; import { bindActionCreators } from 'redux'; -import { connect, useSelector, useDispatch } from 'react-redux'; +import { useSelector, useDispatch } from 'react-redux'; import { withRouter } from 'react-router'; import { useTranslation } from 'react-i18next'; -import PropTypes from 'prop-types'; import styled from 'styled-components'; import * as PreferencesActions from '../IDE/actions/preferences'; @@ -16,7 +15,7 @@ import Header from '../../components/mobile/Header'; import PreferencePicker from '../../components/mobile/PreferencePicker'; import { ExitIcon } from '../../common/icons'; import { remSize, prop } from '../../theme'; -import { optionsOnOff, optionsPickOne, preferenceOnOff } from '../IDE/components/Preferences/PreferenceCreators'; +import { optionsPickOne, preferenceOnOff } from '../IDE/components/Preferences/PreferenceCreators'; const Content = styled.div` z-index: 0; diff --git a/client/modules/Mobile/MobileSketchView.jsx b/client/modules/Mobile/MobileSketchView.jsx index a4238fec07..9491ace21f 100644 --- a/client/modules/Mobile/MobileSketchView.jsx +++ b/client/modules/Mobile/MobileSketchView.jsx @@ -1,7 +1,6 @@ import React from 'react'; import { bindActionCreators } from 'redux'; import { useSelector, useDispatch } from 'react-redux'; -import styled from 'styled-components'; import Header from '../../components/mobile/Header'; import IconButton from '../../components/mobile/IconButton'; import PreviewFrame from '../IDE/components/PreviewFrame'; @@ -16,7 +15,6 @@ import * as FilesActions from '../IDE/actions/files'; import { getHTMLFile } from '../IDE/reducers/files'; import { ExitIcon } from '../../common/icons'; -import { remSize } from '../../theme'; import Footer from '../../components/mobile/Footer'; import Content from './MobileViewContent'; diff --git a/client/modules/Mobile/MobileViewContent.jsx b/client/modules/Mobile/MobileViewContent.jsx index 39d2a59f0d..aeeb81731a 100644 --- a/client/modules/Mobile/MobileViewContent.jsx +++ b/client/modules/Mobile/MobileViewContent.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import styled from 'styled-components'; import { remSize } from '../../theme'; diff --git a/client/modules/User/components/APIKeyForm.jsx b/client/modules/User/components/APIKeyForm.jsx index f586b41b25..2123c5333f 100644 --- a/client/modules/User/components/APIKeyForm.jsx +++ b/client/modules/User/components/APIKeyForm.jsx @@ -68,7 +68,9 @@ class APIKeyForm extends React.Component {

    {this.props.t('APIKeyForm.CreateToken')}

    - + {owner.username}

    -

    {this.props.t('Collection.NumSketches', { count: items.length }) }

    +

    + {this.props.t('Collection.NumSketches', { count: items.length }) } +

    @@ -348,7 +350,11 @@ class Collection extends React.Component { } {field === fieldName && direction === SortingActions.DIRECTION.DESC && - + } diff --git a/client/modules/User/components/CollectionCreate.jsx b/client/modules/User/components/CollectionCreate.jsx index 9a7b6315c8..cdd2988c86 100644 --- a/client/modules/User/components/CollectionCreate.jsx +++ b/client/modules/User/components/CollectionCreate.jsx @@ -71,7 +71,9 @@ class CollectionCreate extends React.Component { {invalid && {this.props.t('CollectionCreate.NameRequired')}}

    - +