aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-06-27 13:19:56 +0200
committerMiodec <[email protected]>2024-06-27 13:20:06 +0200
commit00d73be17f0d3a9ee97ed4277b6f1658a2071a7c (patch)
treed71fadc7d8ded26f5ed038c1a2c993cde7af9246
parent5da8c6ed8c9b1198279af705e2fd434cc2e7dbb4 (diff)
downloadmonkeytype-00d73be17f0d3a9ee97ed4277b6f1658a2071a7c.tar.gz
monkeytype-00d73be17f0d3a9ee97ed4277b6f1658a2071a7c.zip
impr(dev options modal): add button to show test notifications
!nuf
-rw-r--r--frontend/src/html/popups.html1
-rw-r--r--frontend/src/ts/modals/dev-options.ts14
2 files changed, 15 insertions, 0 deletions
diff --git a/frontend/src/html/popups.html b/frontend/src/html/popups.html
index 67cc9a165..21e399bf5 100644
--- a/frontend/src/html/popups.html
+++ b/frontend/src/html/popups.html
@@ -9,6 +9,7 @@
<div class="title">Dev options</div>
<button class="generateData">generate data</button>
<button class="toggleMediaQueryDebug">toggle media query debug</button>
+ <button class="showTestNotifications">show test notifications</button>
</div>
</dialog>
diff --git a/frontend/src/ts/modals/dev-options.ts b/frontend/src/ts/modals/dev-options.ts
index 65166ccf2..4e8f7ca49 100644
--- a/frontend/src/ts/modals/dev-options.ts
+++ b/frontend/src/ts/modals/dev-options.ts
@@ -15,6 +15,20 @@ async function setup(modalEl: HTMLElement): Promise<void> {
showPopup("devGenerateData");
});
modalEl
+ .querySelector(".showTestNotifications")
+ ?.addEventListener("click", () => {
+ Notifications.add("This is a test", 1, {
+ duration: 0,
+ });
+ Notifications.add("This is a test", 0, {
+ duration: 0,
+ });
+ Notifications.add("This is a test", -1, {
+ duration: 0,
+ });
+ void modal.hide();
+ });
+ modalEl
.querySelector(".toggleMediaQueryDebug")
?.addEventListener("click", () => {
mediaQueryDebugLevel++;