aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-04-01 02:47:49 +0200
committerGitHub <noreply@github.com>2023-04-01 02:47:49 +0200
commit6960a439c9c2af261517b00b0b16a7fc5756c48b (patch)
tree4e1832c5cc295b26046e193ac5cf60bcd2590568 /src/components
parent4dff1c5bd5b16e926bc628acf11118344832a374 (diff)
downloadVencord-6960a439c9c2af261517b00b0b16a7fc5756c48b.tar.gz
Vencord-6960a439c9c2af261517b00b0b16a7fc5756c48b.tar.bz2
Vencord-6960a439c9c2af261517b00b0b16a7fc5756c48b.zip
Add Notification log (#745)
Diffstat (limited to 'src/components')
-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>
);
}