From af6e46bf9dc39a60dec00e79247663fff809c6b4 Mon Sep 17 00:00:00 2001 From: Bouncey Date: Fri, 14 Sep 2018 13:26:52 +0100 Subject: [PATCH] chore(redux): Remove redux from AboutSettings --- client/src/client-only-routes/ShowSettings.js | 9 +++++++-- client/src/components/settings/About.js | 14 +------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/client/src/client-only-routes/ShowSettings.js b/client/src/client-only-routes/ShowSettings.js index d6c2f85597..94b49fd9d7 100644 --- a/client/src/client-only-routes/ShowSettings.js +++ b/client/src/client-only-routes/ShowSettings.js @@ -6,6 +6,7 @@ import { createSelector } from 'reselect'; import { Grid, Button } from '@freecodecamp/react-bootstrap'; import { signInLoadingSelector, userSelector } from '../redux'; +import { submitNewAbout } from '../redux/settings'; import Layout from '../components/Layout'; import Spacer from '../components/helpers/Spacer'; @@ -20,6 +21,7 @@ const propTypes = { picture: PropTypes.string, points: PropTypes.number, showLoading: PropTypes.bool, + submitNewAbout: PropTypes.func.isRequired, theme: PropTypes.string, username: PropTypes.string }; @@ -42,7 +44,8 @@ const mapStateToProps = createSelector( }) ); -const mapDispatchToProps = dispatch => bindActionCreators({}, dispatch); +const mapDispatchToProps = dispatch => + bindActionCreators({ submitNewAbout }, dispatch); function ShowSettings(props) { const { @@ -53,7 +56,8 @@ function ShowSettings(props) { points, theme, location, - name + name, + submitNewAbout } = props; if (showLoading) { @@ -99,6 +103,7 @@ function ShowSettings(props) { name={name} picture={picture} points={points} + submitNewAbout={submitNewAbout} username={username} /> diff --git a/client/src/components/settings/About.js b/client/src/components/settings/About.js index ad7d6c07ab..59ca790dfe 100644 --- a/client/src/components/settings/About.js +++ b/client/src/components/settings/About.js @@ -1,25 +1,16 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { bindActionCreators } from 'redux'; -import { connect } from 'react-redux'; import { FormGroup, ControlLabel, FormControl } from '@freecodecamp/react-bootstrap'; -import { submitNewAbout } from '../../redux/settings'; - import { FullWidthRow, Spacer } from '../helpers'; import ThemeSettings from './Theme'; import UsernameSettings from './Username'; import BlockSaveButton from '../helpers/form/BlockSaveButton'; -const mapStateToProps = () => ({}); - -const mapDispatchToProps = dispatch => - bindActionCreators({ submitNewAbout }, dispatch); - const propTypes = { about: PropTypes.string, currentTheme: PropTypes.string, @@ -200,7 +191,4 @@ class AboutSettings extends Component { AboutSettings.displayName = 'AboutSettings'; AboutSettings.propTypes = propTypes; -export default connect( - mapStateToProps, - mapDispatchToProps -)(AboutSettings); +export default AboutSettings;