Added strict type checking to the project. (#236)
* Implement strict typing (WIP). * changes * Finish type checks * Fix notification icon, matugen settings and update tsconfig. * OSD Styling updates and added the ability to configure OSD duration.
This commit is contained in:
@@ -1,32 +1,17 @@
|
||||
import icons from "../../icons/index.js";
|
||||
import { Notification } from "types/service/notifications.js";
|
||||
import { getNotificationIcon } from "globals/notification.js";
|
||||
|
||||
const NotificationIcon = ({ app_entry, app_icon, app_name }) => {
|
||||
let icon = icons.fallback.notification;
|
||||
|
||||
if (
|
||||
Utils.lookUpIcon(app_name) ||
|
||||
Utils.lookUpIcon(app_name.toLowerCase() || "")
|
||||
)
|
||||
icon = Utils.lookUpIcon(app_name)
|
||||
? app_name
|
||||
: Utils.lookUpIcon(app_name.toLowerCase())
|
||||
? app_name.toLowerCase()
|
||||
: "";
|
||||
|
||||
if (Utils.lookUpIcon(app_icon) && icon === "") icon = app_icon;
|
||||
|
||||
if (Utils.lookUpIcon(app_entry || "") && icon === "") icon = app_entry || "";
|
||||
|
||||
return Widget.Box({
|
||||
css: `
|
||||
const NotificationIcon = ({ app_entry = "", app_icon = "", app_name = "" }: Partial<Notification>) => {
|
||||
return Widget.Box({
|
||||
css: `
|
||||
min-width: 2rem;
|
||||
min-height: 2rem;
|
||||
`,
|
||||
child: Widget.Icon({
|
||||
class_name: "notification-icon",
|
||||
icon,
|
||||
}),
|
||||
});
|
||||
child: Widget.Icon({
|
||||
class_name: "notification-icon",
|
||||
icon: getNotificationIcon(app_name, app_icon, app_entry)
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
export { NotificationIcon };
|
||||
|
||||
Reference in New Issue
Block a user