diff options
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/onboarding_modal.js')
-rw-r--r-- | app/javascript/mastodon/features/ui/components/onboarding_modal.js | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/app/javascript/mastodon/features/ui/components/onboarding_modal.js b/app/javascript/mastodon/features/ui/components/onboarding_modal.js index 7cdd3527a..419a94c2c 100644 --- a/app/javascript/mastodon/features/ui/components/onboarding_modal.js +++ b/app/javascript/mastodon/features/ui/components/onboarding_modal.js @@ -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); - } - - handleSkip (e) { + static propTypes = { + onClose: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + me: ImmutablePropTypes.map.isRequired, + domain: PropTypes.string.isRequired, + admin: ImmutablePropTypes.map + }; + + 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)); |