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

@@ -35,6 +35,7 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
{ name: "conferencing", href: "/settings/my-account/conferencing" },
{ name: "appearance", href: "/settings/my-account/appearance" },
{ name: "out_of_office", href: "/settings/my-account/out-of-office" },
{ name: "push_notifications", href: "/settings/my-account/push-notifications" },
// TODO
// { name: "referrals", href: "/settings/my-account/referrals" },
],
+3
View File
@@ -6,6 +6,7 @@ import React from "react";
import { getLocale } from "@calcom/features/auth/lib/getLocale";
import { IconSprites } from "@calcom/ui";
import { NotificationSoundHandler } from "@calcom/web/components/notification-sound-handler";
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
import { prepareRootMetadata } from "@lib/metadata";
@@ -124,6 +125,8 @@ export default async function RootLayout({ children }: { children: React.ReactNo
]}
/>
<Providers dehydratedState={ssr.dehydrate()}>{children}</Providers>
{!isEmbed && <NotificationSoundHandler />}
<NotificationSoundHandler />
</body>
</html>
);
+5 -1
View File
@@ -5,6 +5,8 @@ import { TrpcProvider } from "app/_trpc/trpc-provider";
import { SessionProvider } from "next-auth/react";
import CacheProvider from "react-inlinesvg/provider";
import { WebPushProvider } from "@calcom/features/notifications/WebPushContext";
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
import PlainChat from "@lib/plain/dynamicProvider";
@@ -20,7 +22,9 @@ export function Providers({ children, dehydratedState }: ProvidersProps) {
<TrpcProvider dehydratedState={dehydratedState}>
{!isBookingPage ? <PlainChat /> : null}
{/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */}
<CacheProvider>{children}</CacheProvider>
<CacheProvider>
<WebPushProvider>{children}</WebPushProvider>
</CacheProvider>
</TrpcProvider>
</SessionProvider>
);
@@ -0,0 +1,27 @@
import { getTranslate } from "app/_utils";
import { _generateMetadata } from "app/_utils";
import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader";
import PushNotificationsView from "~/settings/my-account/push-notifications-view";
export const generateMetadata = async () =>
await _generateMetadata(
(t) => t("push_notifications"),
(t) => t("push_notifications_description")
);
const Page = async () => {
const t = await getTranslate();
return (
<SettingsHeader
title={t("push_notifications")}
description={t("push_notifications_description")}
borderInShellHeader={true}>
<PushNotificationsView />
</SettingsHeader>
);
};
export default Page;