@unbxd-ui/unbxd-react-components 0.2.132 → 0.2.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,7 +26,9 @@ var NotificationComponent = function NotificationComponent(props) {
|
|
|
26
26
|
messageId = props.messageId,
|
|
27
27
|
fadeOut = props.fadeOut,
|
|
28
28
|
fadeOutTime = props.fadeOutTime,
|
|
29
|
-
className = props.className
|
|
29
|
+
className = props.className,
|
|
30
|
+
_props$showClose = props.showClose,
|
|
31
|
+
showClose = _props$showClose === void 0 ? false : _props$showClose;
|
|
30
32
|
var fadeOutMessage = typeof fadeOut !== "undefined" ? fadeOut : appearance === "success";
|
|
31
33
|
var timerID;
|
|
32
34
|
var clearMessage = function clearMessage() {
|
|
@@ -52,7 +54,14 @@ var NotificationComponent = function NotificationComponent(props) {
|
|
|
52
54
|
} else {
|
|
53
55
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
54
56
|
className: "RCB-notif RCB-notif-".concat(appearance, " ").concat(className)
|
|
55
|
-
},
|
|
57
|
+
}, showClose ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
58
|
+
className: "notif-wrapper"
|
|
59
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, children), /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
|
+
className: "".concat(appearance, "-cross-icon"),
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
setHideMessage(true);
|
|
63
|
+
}
|
|
64
|
+
})) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children));
|
|
56
65
|
}
|
|
57
66
|
};
|
|
58
67
|
NotificationComponent.propTypes = {
|
|
@@ -65,7 +74,9 @@ NotificationComponent.propTypes = {
|
|
|
65
74
|
/* Should the message fadeout after (fadeOutTime)ms or not. Default true for success messages only. */
|
|
66
75
|
fadeOut: _propTypes["default"].bool,
|
|
67
76
|
/* fadeout timer, in milliseconds */
|
|
68
|
-
fadeOutTime: _propTypes["default"].number
|
|
77
|
+
fadeOutTime: _propTypes["default"].number,
|
|
78
|
+
/* showClose to hide notification */
|
|
79
|
+
showClose: _propTypes["default"].bool
|
|
69
80
|
};
|
|
70
81
|
NotificationComponent.defaultProps = {
|
|
71
82
|
className: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.RCB-notif{padding:10px;border-radius:3px}.RCB-notif-success{color:#
|
|
1
|
+
.RCB-notif{padding:10px;border-radius:3px}.RCB-notif-success{color:#6DB886;border:solid 1px #6DB886;background-color:#DEF9E7}.RCB-notif-error{color:#CA4646;border:solid 1px #CA4646;background-color:#FFE4E4}.RCB-notif-warning{color:#D5A555;border:solid 1px #D5A555;background-color:#FFF8EC}.RCB-notif-info{color:#3E71F2;border:solid 1px #3E71F2;background-color:#E7EDFF}.notif-wrapper{flex:1;display:flex;align-items:center;justify-content:space-between}
|