@atlaskit/focused-task-close-account
Version:
This package contains all of the UI components needed to assemble the focused tasks for deactivating and deleting users' accounts in accordance with the GDPR "Right to be forgotten".
59 lines • 2.53 kB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
import React from 'react';
import InlineDialog from '@atlaskit/inline-dialog';
export var StatefulInlineDialog = /*#__PURE__*/function (_React$Component) {
function StatefulInlineDialog() {
var _this;
_classCallCheck(this, StatefulInlineDialog);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _callSuper(this, StatefulInlineDialog, [].concat(args));
_defineProperty(_this, "state", {
isOpen: false
});
_defineProperty(_this, "openDialog", function () {
_this.setState({
isOpen: true
});
});
_defineProperty(_this, "closeDialog", function () {
_this.setState({
isOpen: false
});
});
_defineProperty(_this, "handleMouseOver", function () {
_this.openDialog();
});
_defineProperty(_this, "handleMouseOut", function () {
_this.closeDialog();
});
return _this;
}
_inherits(StatefulInlineDialog, _React$Component);
return _createClass(StatefulInlineDialog, [{
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
content = _this$props.content,
placement = _this$props.placement;
return /*#__PURE__*/React.createElement(InlineDialog, {
content: content,
placement: placement,
isOpen: this.state.isOpen
}, /*#__PURE__*/React.createElement("span", {
onMouseOver: this.handleMouseOver,
onMouseOut: this.handleMouseOut
}, children));
}
}]);
}(React.Component);
export default StatefulInlineDialog;