aboutsummaryrefslogtreecommitdiff
path: root/src/api/Notifications/NotificationComponent.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/Notifications/NotificationComponent.tsx')
-rw-r--r--src/api/Notifications/NotificationComponent.tsx12
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();