Add TailwindCSS (#1252)

* Setup TailwindCSS

* Fully setup configuration

* Refactor some tailwind variables
This commit is contained in:
Evan Song
2024-07-06 20:57:32 -07:00
committed by GitHub
parent 0f2ddb452c
commit abec2e48d4
176 changed files with 7905 additions and 7433 deletions

View File

@@ -1,34 +1,37 @@
export const useNotifications = () => useState('notifications', () => [])
/* eslint-disable no-undef */
export const useNotifications = () => useState("notifications", () => []);
export const addNotification = (notification) => {
const notifications = useNotifications()
const notifications = useNotifications();
const existingNotif = notifications.value.find(
(x) =>
x.text === notification.text && x.title === notification.title && x.type === notification.type
)
x.text === notification.text &&
x.title === notification.title &&
x.type === notification.type,
);
if (existingNotif) {
setNotificationTimer(existingNotif)
setNotificationTimer(existingNotif);
return
return;
}
notification.id = new Date()
notification.id = new Date();
setNotificationTimer(notification)
notifications.value.push(notification)
}
setNotificationTimer(notification);
notifications.value.push(notification);
};
export const setNotificationTimer = (notification) => {
if (!notification) return
if (!notification) return;
const notifications = useNotifications()
const notifications = useNotifications();
if (notification.timer) {
clearTimeout(notification.timer)
clearTimeout(notification.timer);
}
notification.timer = setTimeout(() => {
notifications.value.splice(notifications.value.indexOf(notification), 1)
}, 30000)
}
notifications.value.splice(notifications.value.indexOf(notification), 1);
}, 30000);
};