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

39 lines
1.0 KiB
JavaScript

import _extends from "@babel/runtime/helpers/esm/extends";
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
import React, { Component } from 'react';
import Alert from './Alert';
var UncontrolledAlert = /*#__PURE__*/function (_Component) {
_inheritsLoose(UncontrolledAlert, _Component);
function UncontrolledAlert(props) {
var _this;
_this = _Component.call(this, props) || this;
_this.state = {
isOpen: true
};
_this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
return _this;
}
var _proto = UncontrolledAlert.prototype;
_proto.toggle = function toggle() {
this.setState({
isOpen: !this.state.isOpen
});
};
_proto.render = function render() {
return /*#__PURE__*/React.createElement(Alert, _extends({
isOpen: this.state.isOpen,
toggle: this.toggle
}, this.props));
};
return UncontrolledAlert;
}(Component);
export default UncontrolledAlert;