chore(redux): Remove redux from AboutSettings

This commit is contained in:
Bouncey
2018-09-14 13:26:52 +01:00
committed by Stuart Taylor
parent efd8c18f5a
commit af6e46bf9d
2 changed files with 8 additions and 15 deletions

View File

@ -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}
/>
<Spacer />

View File

@ -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;