actual/packages/desktop-client/src/components/TutorialPoints.js
Tom French dc53a74459
Separate external, monorepo and internal imports (#237)
* 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
2022-09-02 12:43:37 +01:00

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
);