@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
26 lines • 1.22 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { PureComponent } from 'react';
import QuestionIcon from '@atlaskit/icon/glyph/question';
import { analyticsService } from '../../analytics';
import ToolbarButton from '../ToolbarButton';
import HelpDialog from '../HelpDialog';
var ToolbarHelp = (function (_super) {
tslib_1.__extends(ToolbarHelp, _super);
function ToolbarHelp() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.toggleHelpDialog = function () {
analyticsService.trackEvent('atlassian.editor.help.button');
_this.props.toggleHelp();
};
return _this;
}
ToolbarHelp.prototype.render = function () {
return (React.createElement("span", null,
React.createElement(ToolbarButton, { onClick: this.toggleHelpDialog, title: "Open help dialog", titlePosition: "left", iconBefore: React.createElement(QuestionIcon, { label: "Open help dialog" }) }),
this.props.showHelp && React.createElement(HelpDialog, { onClick: this.props.toggleHelp })));
};
return ToolbarHelp;
}(PureComponent));
export default ToolbarHelp;
//# sourceMappingURL=index.js.map