Fix linting errors and warnings
This commit is contained in:
parent
b1bfb91f80
commit
7ea4ae5637
6 changed files with 16 additions and 20 deletions
|
@ -1,5 +1,4 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { browserHistory } from 'react-router';
|
import { browserHistory } from 'react-router';
|
||||||
|
|
||||||
|
@ -8,7 +7,7 @@ const RedirectToUser = ({ username, url = '/:username/sketches' }) => {
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
browserHistory.replace(url.replace(':username', username));
|
browserHistory.replace(url.replace(':username', username));
|
||||||
}, [username]);
|
}, [username]);
|
||||||
|
|
||||||
|
@ -23,6 +22,6 @@ function mapStateToProps(state) {
|
||||||
|
|
||||||
const ConnectedRedirectToUser = connect(mapStateToProps)(RedirectToUser);
|
const ConnectedRedirectToUser = connect(mapStateToProps)(RedirectToUser);
|
||||||
|
|
||||||
const createRedirectWithUsername = (url) => (props) => <ConnectedRedirectToUser {...props} url={url} />;
|
const createRedirectWithUsername = url => props => <ConnectedRedirectToUser {...props} url={url} />;
|
||||||
|
|
||||||
export default createRedirectWithUsername;
|
export default createRedirectWithUsername;
|
||||||
|
|
|
@ -39,7 +39,10 @@ class App extends React.Component {
|
||||||
App.propTypes = {
|
App.propTypes = {
|
||||||
children: PropTypes.element,
|
children: PropTypes.element,
|
||||||
location: PropTypes.shape({
|
location: PropTypes.shape({
|
||||||
pathname: PropTypes.string
|
pathname: PropTypes.string,
|
||||||
|
state: PropTypes.shape({
|
||||||
|
skipSavingPath: PropTypes.bool,
|
||||||
|
}),
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
setPreviousPath: PropTypes.func.isRequired,
|
setPreviousPath: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { browserHistory } from 'react-router';
|
import { browserHistory } from 'react-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import crypto from 'crypto';
|
|
||||||
import * as ActionTypes from '../../constants';
|
import * as ActionTypes from '../../constants';
|
||||||
import { showErrorModal, justOpenedProject } from '../IDE/actions/ide';
|
import { showErrorModal, justOpenedProject } from '../IDE/actions/ide';
|
||||||
import { showToast, setToastText } from '../IDE/actions/toast';
|
import { showToast, setToastText } from '../IDE/actions/toast';
|
||||||
|
|
|
@ -27,16 +27,14 @@ Tab.propTypes = {
|
||||||
to: PropTypes.string.isRequired,
|
to: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
const DashboardTabSwitcher = ({ currentTab, isOwner, username }) => {
|
const DashboardTabSwitcher = ({ currentTab, isOwner, username }) => (
|
||||||
return (
|
<ul className="dashboard-header__switcher">
|
||||||
<ul className="dashboard-header__switcher">
|
<div className="dashboard-header__tabs">
|
||||||
<div className="dashboard-header__tabs">
|
<Tab to={`/${username}/sketches`} isSelected={currentTab === 'sketches'}>Sketches</Tab>
|
||||||
<Tab to={`/${username}/sketches`} isSelected={currentTab === 'sketches'}>Sketches</Tab>
|
{isOwner && <Tab to={`/${username}/assets`} isSelected={currentTab === 'assets'}>Assets</Tab>}
|
||||||
{isOwner && <Tab to={`/${username}/assets`} isSelected={currentTab === 'assets'}>Assets</Tab>}
|
</div>
|
||||||
</div>
|
</ul>
|
||||||
</ul>
|
);
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
DashboardTabSwitcher.propTypes = {
|
DashboardTabSwitcher.propTypes = {
|
||||||
currentTab: PropTypes.string.isRequired,
|
currentTab: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { reduxForm } from 'redux-form';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { browserHistory } from 'react-router';
|
import { browserHistory } from 'react-router';
|
||||||
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
|
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
|
||||||
import InlineSVG from 'react-inlinesvg';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions';
|
import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions';
|
||||||
|
@ -14,8 +13,6 @@ import GithubButton from '../components/GithubButton';
|
||||||
import APIKeyForm from '../components/APIKeyForm';
|
import APIKeyForm from '../components/APIKeyForm';
|
||||||
import NavBasic from '../../../components/NavBasic';
|
import NavBasic from '../../../components/NavBasic';
|
||||||
|
|
||||||
const exitUrl = require('../../../images/exit.svg');
|
|
||||||
|
|
||||||
class AccountView extends React.Component {
|
class AccountView extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { browserHistory, Link } from 'react-router';
|
import { browserHistory } from 'react-router';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions';
|
import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions';
|
||||||
import NavBasic from '../../../components/NavBasic';
|
import NavBasic from '../../../components/NavBasic';
|
||||||
|
@ -80,7 +80,7 @@ class DashboardView extends React.Component {
|
||||||
|
|
||||||
<DashboardTabSwitcher currentTab={currentTab} isOwner={isOwner} username={username} />
|
<DashboardTabSwitcher currentTab={currentTab} isOwner={isOwner} username={username} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="dashboard-content">
|
<div className="dashboard-content">
|
||||||
{
|
{
|
||||||
currentTab === TabKey.sketches ? <SketchList username={username} /> : <AssetList username={username} />
|
currentTab === TabKey.sketches ? <SketchList username={username} /> : <AssetList username={username} />
|
||||||
|
|
Loading…
Reference in a new issue