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:
committed by
Eugen Rochko
parent
44a3584e2d
commit
2991a7cfe6
@ -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));
|
||||
|
Reference in New Issue
Block a user