diff --git a/client/modules/User/pages/AccountView.jsx b/client/modules/User/pages/AccountView.jsx index d1bd6ba9..bac59dbd 100644 --- a/client/modules/User/pages/AccountView.jsx +++ b/client/modules/User/pages/AccountView.jsx @@ -3,13 +3,15 @@ import React from 'react'; import { reduxForm } from 'redux-form'; import { bindActionCreators } from 'redux'; import { Link, browserHistory } from 'react-router'; +import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; import InlineSVG from 'react-inlinesvg'; import axios from 'axios'; import { Helmet } from 'react-helmet'; -import { updateSettings, initiateVerification } from '../actions'; +import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; import AccountForm from '../components/AccountForm'; import { validateSettings } from '../../../utils/reduxFormUtils'; import GithubButton from '../components/GithubButton'; +import APIKeyForm from '../components/APIKeyForm'; const exitUrl = require('../../../images/exit.svg'); const logoUrl = require('../../../images/p5js-logo.svg'); @@ -36,7 +38,7 @@ class AccountView extends React.Component { render() { return ( -
+
p5.js Web Editor | Account @@ -50,12 +52,24 @@ class AccountView extends React.Component {

My Account

- - Advanced Settings -

Or

- + + +
+

Account

+

Access Tokens

+
+
+ + +

Or

+ +
+ + + +
- + ); } } @@ -64,12 +78,15 @@ function mapStateToProps(state) { return { initialValues: state.user, // <- initialValues for reduxForm user: state.user, + apiKeys: state.user.apiKeys, theme: state.preferences.theme }; } function mapDispatchToProps(dispatch) { - return bindActionCreators({ updateSettings, initiateVerification }, dispatch); + return bindActionCreators({ + updateSettings, initiateVerification, createApiKey, removeApiKey + }, dispatch); } function asyncValidate(formProps, dispatch, props) { diff --git a/client/modules/User/pages/AdvancedSettingsView.jsx b/client/modules/User/pages/AdvancedSettingsView.jsx deleted file mode 100644 index 83c7f5e2..00000000 --- a/client/modules/User/pages/AdvancedSettingsView.jsx +++ /dev/null @@ -1,74 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import { connect } from 'react-redux'; -import { bindActionCreators } from 'redux'; -import { browserHistory } from 'react-router'; -import InlineSVG from 'react-inlinesvg'; -import { Helmet } from 'react-helmet'; -import { createApiKey, removeApiKey } from '../actions'; -import APIKeyForm from '../components/APIKeyForm'; - -const exitUrl = require('../../../images/exit.svg'); -const logoUrl = require('../../../images/p5js-logo.svg'); - -class AdvancedSettingsView extends React.Component { - constructor(props) { - super(props); - this.closeAccountPage = this.closeAccountPage.bind(this); - this.gotoHomePage = this.gotoHomePage.bind(this); - } - - componentDidMount() { - document.body.className = this.props.theme; - } - - closeAccountPage() { - browserHistory.goBack(); - } - - gotoHomePage() { - browserHistory.push('/'); - } - - render() { - return ( -
- - p5.js Web Editor | Advanced Settings - -
- - -
-
-

Advanced Settings

- -
-
- ); - } -} - -function mapStateToProps(state) { - return { - initialValues: state.user, // <- initialValues for reduxForm - user: state.user, - apiKeys: state.user.apiKeys, - previousPath: state.ide.previousPath, - theme: state.preferences.theme - }; -} - -function mapDispatchToProps(dispatch) { - return bindActionCreators({ createApiKey, removeApiKey }, dispatch); -} - -AdvancedSettingsView.propTypes = { - theme: PropTypes.string.isRequired -}; - -export default connect(mapStateToProps, mapDispatchToProps)(AdvancedSettingsView); diff --git a/client/routes.jsx b/client/routes.jsx index 9389d226..baa89884 100644 --- a/client/routes.jsx +++ b/client/routes.jsx @@ -9,7 +9,6 @@ import ResetPasswordView from './modules/User/pages/ResetPasswordView'; import EmailVerificationView from './modules/User/pages/EmailVerificationView'; import NewPasswordView from './modules/User/pages/NewPasswordView'; import AccountView from './modules/User/pages/AccountView'; -import AdvancedSettingsView from './modules/User/pages/AdvancedSettingsView'; // import SketchListView from './modules/Sketch/pages/SketchListView'; import { getUser } from './modules/User/actions'; import { stopSketch } from './modules/IDE/actions/ide'; @@ -39,7 +38,6 @@ const routes = store => ( - diff --git a/server/routes/server.routes.js b/server/routes/server.routes.js index 2f39e924..adade10d 100644 --- a/server/routes/server.routes.js +++ b/server/routes/server.routes.js @@ -87,14 +87,6 @@ router.get('/account', (req, res) => { } }); -router.get('/account/advanced', (req, res) => { - if (req.user) { - res.send(renderIndex()); - } else { - res.redirect('/login'); - } -}); - router.get('/about', (req, res) => { res.send(renderIndex()); });