feat: sound on browser push notification (#18548)

* feat: sound on notification

* refactor: add load audio

* chore: remove

* fix: type error

* fix: notification

* fix: prevent multiple initialization
=

* feat: create notification page

* chore: update the mp3 file
This commit is contained in:
Udit Takkar authored and GitHub committed 2025-03-11 11:49:51 +05:30
1 parent 4daad2ac08
commit b0125e1a05
16 files changed
+416 -237

No files matched your search

@@ -0,0 +1,20 @@
"use client";
import { useWebPush } from "@calcom/features/notifications/WebPushContext";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button } from "@calcom/ui";
const PushNotificationsView = () => {
const { t } = useLocale();
const { subscribe, unsubscribe, isSubscribed, isLoading } = useWebPush();
return (
<div className="border-subtle rounded-b-xl border-x border-b px-4 pb-10 pt-8 sm:px-6">
<Button color="primary" onClick={isSubscribed ? unsubscribe : subscribe} disabled={isLoading}>
{isSubscribed ? t("disable_browser_notifications") : t("allow_browser_notifications")}
</Button>
</div>
);
};
export default PushNotificationsView;