generated from nhcarrigan/template
feat: display primary badge in comments
Extend the primary badge selection feature to comments, so users see only their selected badge next to their comments (or all badges if none selected). Changes: - Add primaryBadge field to CommentUser interface - Update comment service mapComment to include primaryBadge - Update comment-display component to show primary badge logic - Import and expose PrimaryBadge enum in comment-display component - Use same conditional logic as profile (show primary or all badges)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { Comment, CreateCommentDto } from "@library/shared-types";
|
||||
import { Comment, CreateCommentDto, PrimaryBadge } from "@library/shared-types";
|
||||
import { prisma } from "../lib/prisma";
|
||||
import createDOMPurify from "dompurify";
|
||||
import { JSDOM } from "jsdom";
|
||||
@@ -65,6 +65,7 @@ export class CommentService {
|
||||
id: comment.user.id,
|
||||
username: comment.user.username,
|
||||
avatar: comment.user.avatar || undefined,
|
||||
primaryBadge: (comment.user.primaryBadge as PrimaryBadge) || undefined,
|
||||
inDiscord: comment.user.inDiscord,
|
||||
isVip: comment.user.isVip,
|
||||
isMod: comment.user.isMod,
|
||||
|
||||
Reference in New Issue
Block a user