chore(redux): Remove redux from AboutSettings
This commit is contained in:
@ -6,6 +6,7 @@ import { createSelector } from 'reselect';
|
|||||||
import { Grid, Button } from '@freecodecamp/react-bootstrap';
|
import { Grid, Button } from '@freecodecamp/react-bootstrap';
|
||||||
|
|
||||||
import { signInLoadingSelector, userSelector } from '../redux';
|
import { signInLoadingSelector, userSelector } from '../redux';
|
||||||
|
import { submitNewAbout } from '../redux/settings';
|
||||||
|
|
||||||
import Layout from '../components/Layout';
|
import Layout from '../components/Layout';
|
||||||
import Spacer from '../components/helpers/Spacer';
|
import Spacer from '../components/helpers/Spacer';
|
||||||
@ -20,6 +21,7 @@ const propTypes = {
|
|||||||
picture: PropTypes.string,
|
picture: PropTypes.string,
|
||||||
points: PropTypes.number,
|
points: PropTypes.number,
|
||||||
showLoading: PropTypes.bool,
|
showLoading: PropTypes.bool,
|
||||||
|
submitNewAbout: PropTypes.func.isRequired,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string,
|
||||||
username: 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) {
|
function ShowSettings(props) {
|
||||||
const {
|
const {
|
||||||
@ -53,7 +56,8 @@ function ShowSettings(props) {
|
|||||||
points,
|
points,
|
||||||
theme,
|
theme,
|
||||||
location,
|
location,
|
||||||
name
|
name,
|
||||||
|
submitNewAbout
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
if (showLoading) {
|
if (showLoading) {
|
||||||
@ -99,6 +103,7 @@ function ShowSettings(props) {
|
|||||||
name={name}
|
name={name}
|
||||||
picture={picture}
|
picture={picture}
|
||||||
points={points}
|
points={points}
|
||||||
|
submitNewAbout={submitNewAbout}
|
||||||
username={username}
|
username={username}
|
||||||
/>
|
/>
|
||||||
<Spacer />
|
<Spacer />
|
||||||
|
@ -1,25 +1,16 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { bindActionCreators } from 'redux';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import {
|
import {
|
||||||
FormGroup,
|
FormGroup,
|
||||||
ControlLabel,
|
ControlLabel,
|
||||||
FormControl
|
FormControl
|
||||||
} from '@freecodecamp/react-bootstrap';
|
} from '@freecodecamp/react-bootstrap';
|
||||||
|
|
||||||
import { submitNewAbout } from '../../redux/settings';
|
|
||||||
|
|
||||||
import { FullWidthRow, Spacer } from '../helpers';
|
import { FullWidthRow, Spacer } from '../helpers';
|
||||||
import ThemeSettings from './Theme';
|
import ThemeSettings from './Theme';
|
||||||
import UsernameSettings from './Username';
|
import UsernameSettings from './Username';
|
||||||
import BlockSaveButton from '../helpers/form/BlockSaveButton';
|
import BlockSaveButton from '../helpers/form/BlockSaveButton';
|
||||||
|
|
||||||
const mapStateToProps = () => ({});
|
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch =>
|
|
||||||
bindActionCreators({ submitNewAbout }, dispatch);
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
about: PropTypes.string,
|
about: PropTypes.string,
|
||||||
currentTheme: PropTypes.string,
|
currentTheme: PropTypes.string,
|
||||||
@ -200,7 +191,4 @@ class AboutSettings extends Component {
|
|||||||
AboutSettings.displayName = 'AboutSettings';
|
AboutSettings.displayName = 'AboutSettings';
|
||||||
AboutSettings.propTypes = propTypes;
|
AboutSettings.propTypes = propTypes;
|
||||||
|
|
||||||
export default connect(
|
export default AboutSettings;
|
||||||
mapStateToProps,
|
|
||||||
mapDispatchToProps
|
|
||||||
)(AboutSettings);
|
|
||||||
|
Reference in New Issue
Block a user