Skip to content

Commit

Permalink
Made the notifications adhere to dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ShamaKamina committed Sep 27, 2024
1 parent 632a00c commit 3b0dc67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/components/Notifications/NotificationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { subscribe } from "@/lib/api/subscription";
import { useQuery } from "@tanstack/react-query";
import { useUser } from "@/lib/contexts/UserContext";
import ErrorDisplay from '@/components/ui/error_display';
import { useTheme } from "next-themes";

import type { NotificationType } from "@/lib/types";
import { formatLongDate } from "@/lib/utils";
Expand Down Expand Up @@ -77,6 +78,8 @@ const NotificationsList: React.FC = () => {
);
}

const { theme } = useTheme();

const addSuspendMessage = (notif: NotificationType) =>
notif.content.includes("external resolution rejected")
? notif.content + " You will be suspended from resolving until " + formatLongDate(
Expand All @@ -92,7 +95,11 @@ const NotificationsList: React.FC = () => {

<li
key={index}
className="flex items-start space-x-3 p-4 hover:bg-gray-50"
className={`flex items-start space-x-3 p-4 transition duration-200
${theme === "dark"
? "hover:bg-[#262626] hover:text-white"
: "hover:bg-gray-300 hover:text-black"}
`}
>
<Link
href={getNotificationLink(notification.type, (notification.type != "points") ? notification.issue_id : "none")}
Expand Down

0 comments on commit 3b0dc67

Please sign in to comment.