* refactor: move Segment, BookerLayoutSelector, CreateLicenseKeyForm from packages/features to apps/web/modules Co-Authored-By: [email protected] <[email protected]> * fix: update relative imports to absolute paths in moved files Co-Authored-By: [email protected] <[email protected]> * refactor: move useBookingLocation and blocklist components from packages/features to apps/web/modules Co-Authored-By: [email protected] <[email protected]> * refactor: move EmbedTabs and embed hooks from packages/features to apps/web/modules Co-Authored-By: [email protected] <[email protected]> * fix * migrate useBookerUrl * migrate embed tabs * fix * fix * fix * mv ThemeLabel * mv settings headers to webn * update imports * clean up --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
27 lines
990 B
TypeScript
27 lines
990 B
TypeScript
"use client";
|
|
|
|
import { useWebPush } from "@calcom/web/modules/notifications/hooks/useWebPush";
|
|
import SettingsHeader from "@calcom/web/modules/settings/components/SettingsHeader";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import { Button } from "@calcom/ui/components/button";
|
|
|
|
const PushNotificationsView = () => {
|
|
const { t } = useLocale();
|
|
const { subscribe, unsubscribe, isSubscribed, isLoading } = useWebPush();
|
|
|
|
return (
|
|
<SettingsHeader
|
|
title={t("push_notifications")}
|
|
description={t("push_notifications_description")}
|
|
borderInShellHeader={true}>
|
|
<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>
|
|
</SettingsHeader>
|
|
);
|
|
};
|
|
|
|
export default PushNotificationsView;
|