@botonic/react
Version:
Build Chatbots using React
24 lines • 1.37 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.useNotifications = void 0;
const react_1 = require("react");
const constants_1 = require("../../constants");
const context_1 = require("../../webchat/context");
function useNotifications() {
const { getThemeProperty } = (0, react_1.useContext)(context_1.WebchatContext);
const CustomUnreadMessagesBanner = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerCustom);
const notificationsBannerEnabled = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerEnabled);
const notificationsEnabled = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.notificationsEnabled, CustomUnreadMessagesBanner || notificationsBannerEnabled);
const bannerText = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerText);
const CustomScrollButton = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.scrollButtonCustom);
const scrollButtonEnabled = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.scrollButtonEnabled, CustomScrollButton);
return {
notificationsEnabled,
bannerText,
CustomUnreadMessagesBanner,
CustomScrollButton,
scrollButtonEnabled,
};
}
exports.useNotifications = useNotifications;
//# sourceMappingURL=use-notifications.js.map
;