Skip to content

Commit eef9ff2

Browse files
committed
fix: restore notifications functionality and update card styling
- Add missing postId and commentId to notification inserts in comment and discussion routers - Update notification table foreign keys to reference new posts/comments tables instead of legacy Post/Comment tables - Change postId column type from text to uuid and commentId from integer to uuid to match new table schemas - Update notification cards with modern grey/white styling (rounded corners, proper borders, hover effects) - Add E2E tests for notification display and creation flow - Add seed script for testing notifications locally
1 parent ce6e404 commit eef9ff2

10 files changed

Lines changed: 5560 additions & 8 deletions

File tree

app/(app)/notifications/_client.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { api } from "@/server/trpc/react";
1414

1515
// Moved outside to avoid "cannot create components during render" error
1616
const Placeholder = () => (
17-
<div className="my-4 w-full border border-neutral-100 bg-neutral-100 p-4 shadow dark:border-white dark:bg-black">
17+
<div className="my-2 w-full rounded-lg border border-neutral-200 bg-white p-4 dark:border-neutral-700 dark:bg-neutral-900">
1818
<div className="animate-pulse">
1919
<div className="flex space-x-4">
2020
<div className="h-10 w-10 rounded-full bg-gray-300 dark:bg-neutral-800"></div>
@@ -138,7 +138,7 @@ const Notifications = () => {
138138
return null;
139139
return (
140140
<div key={id}>
141-
<div className="my-2 flex justify-between border border-neutral-300 bg-white p-4 text-neutral-800 dark:border-white dark:bg-black dark:text-neutral-200">
141+
<div className="my-2 flex justify-between rounded-lg border border-neutral-200 bg-white p-4 text-neutral-800 transition-colors hover:border-neutral-300 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:hover:border-neutral-600">
142142
<div>
143143
<div className="flex gap-3 sm:gap-5">
144144
<div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ALTER TABLE "Notification" DROP CONSTRAINT "Notification_postId_Post_id_fk";
2+
--> statement-breakpoint
3+
ALTER TABLE "Notification" DROP CONSTRAINT "Notification_commentId_Comment_id_fk";
4+
--> statement-breakpoint
5+
ALTER TABLE "Notification" ADD CONSTRAINT "Notification_postId_posts_id_fk" FOREIGN KEY ("postId") REFERENCES "public"."posts"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint
6+
ALTER TABLE "Notification" ADD CONSTRAINT "Notification_commentId_comments_id_fk" FOREIGN KEY ("commentId") REFERENCES "public"."comments"("id") ON DELETE cascade ON UPDATE cascade;

0 commit comments

Comments
 (0)