Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

chore: Add notifications settings page and preferences component

Kiran K3dd3ae0ea186
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/layout.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/layout.tsx
index 12fab91219..1e67c9ebd2 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/layout.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/layout.tsx
@@ -6,6 +6,7 @@ import {
Receipt2,
ShieldCheck,
Users6,
+ WindowSettings,
} from "@dub/ui/src/icons";
import { ReactNode } from "react";
@@ -45,6 +46,11 @@ export default function WorkspaceSettingsLayout({
icon: ShieldCheck,
segment: "security",
},
+ {
+ name: "Notifications",
+ icon: WindowSettings,
+ segment: "notifications",
+ },
];
return (
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/notifications/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/notifications/page.tsx
new file mode 100644
index 0000000000..f83c387df1
--- /dev/null
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/notifications/page.tsx
@@ -0,0 +1,5 @@
+import { NotificationPreferences } from "./preferences";
+
+export default function Page() {
+ return <NotificationPreferences />;
+}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/notifications/preferences.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/notifications/preferences.tsx
new file mode 100644
index 0000000000..bb2b89b80d
--- /dev/null
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/notifications/preferences.tsx
@@ -0,0 +1,45 @@
+const preferences = [
+ {
+ key: "links_usage_summary",
+ title: "Monthly links usage summary",
+ },
+ {
+ key: "domain_configuration",
+ title: "Domain configuration warnings",
+ },
+];
+
+export const NotificationPreferences = () => {
+ return (
+ <>
+ <div className="rounded-lg border border-gray-200 bg-white">
+ <div className="flex flex-col items-center justify-between gap-4 space-y-3 border-b border-gray-200 p-5 sm:flex-row sm:space-y-0 sm:p-10">
+ <div className="flex max-w-screen-sm flex-col space-y-3">
+ <h2 className="text-xl font-medium">Notifications</h2>
+ <p className="text-sm text-gray-500">
+ Adjust your notification preferences and choose which updates you
+ want to receive.
+ </p>
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-2 p-5 sm:p-10">
+ {preferences.map((preference) => (
+ <Preference key={preference.key} title={preference.title} />
+ ))}
+ </div>
+ </div>
+ </>
+ );
+};
+
+const Preference = ({ key, title }: { key: string; title: string }) => {
+ return (
+ <div key={key}>
+ <label className="flex items-center text-gray-700 font-medium">
+ <input type="checkbox" />
+ <span className="ml-2 text-sm">{title}</span>
+ </label>
+ </div>
+ );
+};