Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): add anonymous views toggle to notification settings UI

Richie McIlroyee9a373f0cb6
diff --git a/apps/web/app/(org)/dashboard/_components/Notifications/SettingsDropdown.tsx b/apps/web/app/(org)/dashboard/_components/Notifications/SettingsDropdown.tsx
index 0e0af8031..7e894f537 100644
--- a/apps/web/app/(org)/dashboard/_components/Notifications/SettingsDropdown.tsx
+++ b/apps/web/app/(org)/dashboard/_components/Notifications/SettingsDropdown.tsx
@@ -5,6 +5,7 @@ import {
faCog,
faComment,
faEye,
+ faEyeSlash,
faReply,
faThumbsUp,
type IconDefinition,
@@ -20,13 +21,19 @@ import { useDashboardContext } from "../../Contexts";
type NotificationOption = {
icon: IconDefinition;
label: string;
- value: "pauseComments" | "pauseViews" | "pauseReactions" | "pauseReplies";
+ value:
+ | "pauseComments"
+ | "pauseViews"
+ | "pauseReactions"
+ | "pauseReplies"
+ | "pauseAnonViews";
};
const notificationOptions: NotificationOption[] = [
{ icon: faComment, label: "Comments", value: "pauseComments" },
{ icon: faReply, label: "Replies", value: "pauseReplies" },
{ icon: faEye, label: "Views", value: "pauseViews" },
+ { icon: faEyeSlash, label: "Anonymous views", value: "pauseAnonViews" },
{ icon: faThumbsUp, label: "Reactions", value: "pauseReactions" },
];
@@ -41,6 +48,7 @@ export const SettingsDropdown = () => {
pauseReplies: false,
pauseViews: false,
pauseReactions: false,
+ pauseAnonViews: false,
};
await updatePreferences({
@@ -131,7 +139,7 @@ export const SettingsDropdown = () => {
</p>
</div>
- {userPreferences?.notifications[option.value] && (
+ {userPreferences?.notifications?.[option.value] && (
<FontAwesomeIcon
icon={faCheck}
className="text-gray-10 size-2.5 transition-colors group-hover:text-gray-12"