Added configuration options for notifications.

This commit is contained in:
Jas Singh
2024-07-27 00:54:56 -07:00
parent 77c79a2d99
commit d8e58546ad
4 changed files with 14 additions and 3 deletions

View File

@@ -8,10 +8,14 @@ import { Body } from "./body/index.js";
import { CloseButton } from "./close/index.js";
import { NotificationAnchor } from "lib/types/options";
const { position } = options.notifications;
const { position, timeout, cache_actions } = options.notifications;
export default () => {
notifs.popupTimeout = 7000;
Utils.merge([timeout.bind("value"), cache_actions.bind("value")], (timeout, doCaching) => {
notifs.popupTimeout = timeout;
notifs.cacheActions = doCaching;
});
const getPosition = (pos: NotificationAnchor): ("top" | "bottom" | "left" | "right")[] => {
const positionMap: { [key: string]: ("top" | "bottom" | "left" | "right")[] } = {
"top": ["top"],