Repository URL to install this package:
|
Version:
2.7.3 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const styled_1 = require("./styled");
function defaultRenderMessage(props, state) {
const {
label
} = props;
return label && react_1.default.createElement(styled_1.Message, {
text: label
});
}
exports.defaultRenderMessage = defaultRenderMessage;
function defaultRenderActionButtons(props, state) {
return '';
}
exports.defaultRenderActionButtons = defaultRenderActionButtons;
/**
* @todo there is accessibility required on this
* @todo or this has to be an observer...
*/
function defaultRenderWrap(props, state) {
console.debug('[SnackBar] _defaultRenderWrap');
return react_1.default.createElement(styled_1.SnackBarWrapper, {
position: props.position,
className: props.className,
isVisible: state.isVisible
}, props.children);
}
exports.defaultRenderWrap = defaultRenderWrap;
function renderChildren(props, state) {
const {
renderMessage,
renderActionButtonGroup,
renderWrap
} = props,
remainingProps = tslib_1.__rest(props, ["renderMessage", "renderActionButtonGroup", "renderWrap"]);
const messageView = renderMessage(props);
const actionButtonView = renderActionButtonGroup(props); // shouldn't need this, except we can handle accessibility
const children = react_1.default.createElement(react_1.default.Fragment, null, messageView, actionButtonView);
return children;
}
exports.renderChildren = renderChildren; //# sourceMappingURL=renderProps.js.map