diff options
author | V <vendicated@riseup.net> | 2023-04-01 02:47:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-01 02:47:49 +0200 |
commit | 6960a439c9c2af261517b00b0b16a7fc5756c48b (patch) | |
tree | 4e1832c5cc295b26046e193ac5cf60bcd2590568 /src/api/Notifications/NotificationComponent.tsx | |
parent | 4dff1c5bd5b16e926bc628acf11118344832a374 (diff) | |
download | Vencord-6960a439c9c2af261517b00b0b16a7fc5756c48b.tar.gz Vencord-6960a439c9c2af261517b00b0b16a7fc5756c48b.tar.bz2 Vencord-6960a439c9c2af261517b00b0b16a7fc5756c48b.zip |
Add Notification log (#745)
Diffstat (limited to 'src/api/Notifications/NotificationComponent.tsx')
-rw-r--r-- | src/api/Notifications/NotificationComponent.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/api/Notifications/NotificationComponent.tsx b/src/api/Notifications/NotificationComponent.tsx index 53c1b81..542c29b 100644 --- a/src/api/Notifications/NotificationComponent.tsx +++ b/src/api/Notifications/NotificationComponent.tsx @@ -20,6 +20,7 @@ import "./styles.css"; import { useSettings } from "@api/settings"; import ErrorBoundary from "@components/ErrorBoundary"; +import { classes } from "@utils/misc"; import { React, useEffect, useMemo, useState, useStateFromStores, WindowStore } from "@webpack/common"; import { NotificationData } from "./Notifications"; @@ -33,8 +34,10 @@ export default ErrorBoundary.wrap(function NotificationComponent({ onClick, onClose, image, - permanent -}: NotificationData) { + permanent, + className, + dismissOnClick +}: NotificationData & { className?: string; }) { const { timeout, position } = useSettings(["notifications.timeout", "notifications.position"]).notifications; const hasFocus = useStateFromStores([WindowStore], () => WindowStore.isFocused()); @@ -61,11 +64,12 @@ export default ErrorBoundary.wrap(function NotificationComponent({ return ( <button - className="vc-notification-root" + className={classes("vc-notification-root", className)} style={position === "bottom-right" ? { bottom: "1rem" } : { top: "3rem" }} onClick={() => { - onClose!(); onClick?.(); + if (dismissOnClick !== false) + onClose!(); }} onContextMenu={e => { e.preventDefault(); |