import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
+import key from 'keymaster';
import TokenStep from './TokenStep';
import OrganizationStep from './OrganizationStep';
import AnalysisStep from './AnalysisStep';
componentDidMount() {
this.mounted = true;
+ this.attachShortcuts();
if (!this.props.currentUser.isLoggedIn) {
handleRequiredAuthentication();
}
componentWillUnmount() {
this.mounted = false;
+ this.detachShortcuts();
+ }
+
+ attachShortcuts() {
+ key.setScope('onboarding');
+ key('esc', 'onboarding', () => {
+ this.finishOnboarding();
+ return false;
+ });
+ }
+
+ detachShortcuts() {
+ key.deleteScope('onboarding');
}
finishOnboarding = () => {