GoScrobble/web/node_modules/reactstrap/lib/UncontrolledAlert.js

53 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-04-25 02:47:15 +00:00
"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;