0
0
Fork 0

Use ES Class Fields & Static Properties (#3008)

Use ES Class Fields & Static Properties (currently stage 2) for improve class outlook.

Added babel-plugin-transform-class-properties as a Babel plugin.
This commit is contained in:
Yamagishi Kazutoshi 2017-05-12 21:44:10 +09:00 committed by Eugen Rochko
parent 44a3584e2d
commit 2991a7cfe6
79 changed files with 838 additions and 1128 deletions

View file

@ -165,27 +165,29 @@ const mapStateToProps = state => ({
class OnboardingModal extends React.PureComponent {
constructor (props, context) {
super(props, context);
this.state = {
currentIndex: 0
};
this.handleSkip = this.handleSkip.bind(this);
this.handleDot = this.handleDot.bind(this);
this.handleNext = this.handleNext.bind(this);
}
static propTypes = {
onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
me: ImmutablePropTypes.map.isRequired,
domain: PropTypes.string.isRequired,
admin: ImmutablePropTypes.map
};
handleSkip (e) {
state = {
currentIndex: 0
};
handleSkip = (e) => {
e.preventDefault();
this.props.onClose();
}
handleDot (i, e) {
handleDot = (i, e) => {
e.preventDefault();
this.setState({ currentIndex: i });
}
handleNext (maxNum, e) {
handleNext = (maxNum, e) => {
e.preventDefault();
if (this.state.currentIndex < maxNum - 1) {
@ -253,12 +255,4 @@ class OnboardingModal extends React.PureComponent {
}
OnboardingModal.propTypes = {
onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
me: ImmutablePropTypes.map.isRequired,
domain: PropTypes.string.isRequired,
admin: ImmutablePropTypes.map
}
export default connect(mapStateToProps)(injectIntl(OnboardingModal));