feat(02-02): social + safety UI — FollowButton, PetListItem, BlockDialog, ReportSheet, followers/following pages
- FollowButton: optimistic follow/unfollow, revert on error, AlertDialog unfollow confirm (SOCL-01/02)
- PetListItem: avatar + name + species badge + right-aligned FollowButton (SOCL-03)
- BlockDialog: AlertDialog with exact UI-SPEC copy, destructive Block CTA (SAFE-01)
- ReportSheet: 5 RadioGroup reasons, notes Textarea, destructive Submit CTA (SAFE-02)
- followers/page.tsx: RSC shell "{N} Followers" heading + FollowersList client (SOCL-03)
- following/page.tsx: RSC shell "Following {N}" heading + FollowingList client (SOCL-03)
- pets/[petId]/page.tsx: stats row (posts/followers/following) + ProfileActions (SOCL-03)
- ProfileActions: FollowButton + MoreHorizontal options menu + BlockDialog + ReportSheet
- Fix: test prisma cast to `as any` resolving TS2322 type errors (Rule 1 - Bug)
- tsc exits 0; vitest 36 passed
This commit is contained in:
1 parent
e9b286b4df
commit
0428cf2a04
13 files changed
+842
-5
No files matched your search
@@ -64,9 +64,10 @@ async function createBlocksCaller(overrides?: {
|
||||
blocks: blocksRouter,
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const caller = testRouter.createCaller({
|
||||
userId,
|
||||
prisma: mockPrisma as unknown as import("@prisma/client").PrismaClient,
|
||||
prisma: mockPrisma as any,
|
||||
});
|
||||
|
||||
return { caller, mockPrisma };
|
||||
|
||||
@@ -74,9 +74,10 @@ async function createFollowsCaller(overrides?: {
|
||||
});
|
||||
|
||||
// Use the appRouter caller pattern with injected context
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const caller = testRouter.createCaller({
|
||||
userId,
|
||||
prisma: mockPrisma as unknown as import("@prisma/client").PrismaClient,
|
||||
prisma: mockPrisma as any,
|
||||
});
|
||||
|
||||
return { caller, mockPrisma };
|
||||
|
||||
@@ -66,9 +66,10 @@ async function createReportsCaller(overrides?: {
|
||||
reports: reportsRouter,
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const caller = testRouter.createCaller({
|
||||
userId,
|
||||
prisma: mockPrisma as unknown as import("@prisma/client").PrismaClient,
|
||||
prisma: mockPrisma as any,
|
||||
});
|
||||
|
||||
return { caller, mockPrisma };
|
||||
|
||||
Reference in new issue
Block a user