aboutsummaryrefslogtreecommitdiff
path: root/src/components/VencordSettings/VencordTab.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/VencordSettings/VencordTab.tsx')
-rw-r--r--src/components/VencordSettings/VencordTab.tsx28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx
index 120f4c5..7113421 100644
--- a/src/components/VencordSettings/VencordTab.tsx
+++ b/src/components/VencordSettings/VencordTab.tsx
@@ -17,6 +17,7 @@
*/
+import { openNotificationLogModal } from "@api/Notifications/notificationLog";
import { useSettings } from "@api/settings";
import { classNameFactory } from "@api/Styles";
import DonateButton from "@components/DonateButton";
@@ -165,7 +166,7 @@ function VencordSettings() {
{ label: "Only use Desktop notifications when Discord is not focused", value: "not-focused", default: true },
{ label: "Always use Desktop notifications", value: "always" },
{ label: "Always use Vencord notifications", value: "never" },
- ]satisfies Array<{ value: typeof settings["notifications"]["useNative"]; } & Record<string, any>>}
+ ] satisfies Array<{ value: typeof settings["notifications"]["useNative"]; } & Record<string, any>>}
closeOnSelect={true}
select={v => notifSettings.useNative = v}
isSelected={v => v === notifSettings.useNative}
@@ -179,7 +180,7 @@ function VencordSettings() {
options={[
{ label: "Bottom Right", value: "bottom-right", default: true },
{ label: "Top Right", value: "top-right" },
- ]satisfies Array<{ value: typeof settings["notifications"]["position"]; } & Record<string, any>>}
+ ] satisfies Array<{ value: typeof settings["notifications"]["position"]; } & Record<string, any>>}
select={v => notifSettings.position = v}
isSelected={v => v === notifSettings.position}
serialize={identity}
@@ -198,6 +199,29 @@ function VencordSettings() {
onMarkerRender={v => (v / 1000) + "s"}
stickToMarkers={false}
/>
+
+ <Forms.FormTitle tag="h5" className={Margins.top16 + " " + Margins.bottom8}>Notification Log Limit</Forms.FormTitle>
+ <Forms.FormText className={Margins.bottom16}>
+ The amount of notifications to save in the log until old ones are removed.
+ Set to <code>0</code> to disable Notification log and <code>∞</code> to never automatically remove old Notifications
+ </Forms.FormText>
+ <Slider
+ markers={[0, 25, 50, 75, 100, 200]}
+ minValue={0}
+ maxValue={200}
+ stickToMarkers={true}
+ initialValue={notifSettings.logLimit}
+ onValueChange={v => notifSettings.logLimit = v}
+ onValueRender={v => v === 200 ? "∞" : v}
+ onMarkerRender={v => v === 200 ? "∞" : v}
+ />
+
+ <Button
+ onClick={openNotificationLogModal}
+ disabled={notifSettings.logLimit === 0}
+ >
+ Open Notification Log
+ </Button>
</React.Fragment>
);
}