refactor(ui/notify): Cleanup internal code & new config options

This commit is contained in:
Taso
2021-10-13 20:19:36 -04:00
parent 57e895de19
commit e719bc6569
7 changed files with 202 additions and 43 deletions
+44
View File
@@ -0,0 +1,44 @@
// Will register dev utilities on window
export const registerWindowMethods = () => {
window.SendNotification = (data) => {
window.dispatchEvent(
new MessageEvent("message", {
data: {
action: "notify",
...data,
},
})
);
};
};
// Used for browser env handling
export const BrowserMockConfigData = {
NotificationStyling: {
group: true,
position: "top-right",
progress: true,
},
VariantDefinitions: {
success: {
color: "green",
icon: "done",
},
primary: {
color: "blue",
icon: "info",
},
error: {
color: "red",
icon: "dangerous",
},
police: {
color: "blue",
icon: "local_police",
},
ambulance: {
color: "red",
icon: "fas fa-ambulance",
},
},
};