dc53a74459
* style: enforce ordering of imports * style: sort imports in loot-core * style: sort imports in desktop-client * style: sort imports in loot-design * style: manual fixes
42 lines
840 B
JavaScript
42 lines
840 B
JavaScript
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
class Tutorial extends React.Component {
|
|
static childContextTypes = {
|
|
setTutorialNode: PropTypes.func,
|
|
getTutorialNode: PropTypes.func,
|
|
endTutorial: PropTypes.func
|
|
};
|
|
|
|
constructor() {
|
|
super();
|
|
this.nodes = {};
|
|
}
|
|
|
|
getChildContext() {
|
|
return {
|
|
setTutorialNode: this.setTutorialNode,
|
|
getTutorialNode: this.getTutorialNode
|
|
};
|
|
}
|
|
|
|
setTutorialNode = (name, node, expand) => {
|
|
this.nodes[name] = { node, expand };
|
|
};
|
|
|
|
getTutorialNode = (name, node) => {
|
|
return this.nodes[name];
|
|
};
|
|
|
|
render() {
|
|
const { children } = this.props;
|
|
return React.Children.only(children);
|
|
}
|
|
}
|
|
|
|
export default connect(state => ({ deactivated: state.tutorial.deactivated }))(
|
|
Tutorial
|
|
);
|