mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
|
"use strict";
|
||
|
|
||
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
||
|
|
||
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.default = void 0;
|
||
|
|
||
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||
|
|
||
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
||
|
|
||
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
||
|
|
||
|
var _react = _interopRequireWildcard(require("react"));
|
||
|
|
||
|
var _Alert = _interopRequireDefault(require("./Alert"));
|
||
|
|
||
|
var UncontrolledAlert = /*#__PURE__*/function (_Component) {
|
||
|
(0, _inheritsLoose2.default)(UncontrolledAlert, _Component);
|
||
|
|
||
|
function UncontrolledAlert(props) {
|
||
|
var _this;
|
||
|
|
||
|
_this = _Component.call(this, props) || this;
|
||
|
_this.state = {
|
||
|
isOpen: true
|
||
|
};
|
||
|
_this.toggle = _this.toggle.bind((0, _assertThisInitialized2.default)(_this));
|
||
|
return _this;
|
||
|
}
|
||
|
|
||
|
var _proto = UncontrolledAlert.prototype;
|
||
|
|
||
|
_proto.toggle = function toggle() {
|
||
|
this.setState({
|
||
|
isOpen: !this.state.isOpen
|
||
|
});
|
||
|
};
|
||
|
|
||
|
_proto.render = function render() {
|
||
|
return /*#__PURE__*/_react.default.createElement(_Alert.default, (0, _extends2.default)({
|
||
|
isOpen: this.state.isOpen,
|
||
|
toggle: this.toggle
|
||
|
}, this.props));
|
||
|
};
|
||
|
|
||
|
return UncontrolledAlert;
|
||
|
}(_react.Component);
|
||
|
|
||
|
var _default = UncontrolledAlert;
|
||
|
exports.default = _default;
|