feat: show user avatar on comments and activity (#331)
Display user profile pictures instead of initials on card comments and activity items. Fetches the user image field from the database and passes imageUrl to the Avatar component. Co-authored-by: Sachin Divekar <sachin.divekar@remiges.tech>
This commit is contained in:
@@ -12,6 +12,7 @@ import { useModal } from "~/providers/modal";
|
||||
import { usePopup } from "~/providers/popup";
|
||||
import { api } from "~/utils/api";
|
||||
import { invalidateCard } from "~/utils/cardInvalidation";
|
||||
import { getAvatarUrl } from "~/utils/helpers";
|
||||
|
||||
interface FormValues {
|
||||
comment: string;
|
||||
@@ -22,6 +23,7 @@ const Comment = ({
|
||||
cardPublicId,
|
||||
name,
|
||||
email,
|
||||
image,
|
||||
isLoading,
|
||||
createdAt,
|
||||
comment,
|
||||
@@ -34,6 +36,7 @@ const Comment = ({
|
||||
cardPublicId: string;
|
||||
name: string;
|
||||
email: string;
|
||||
image: string | null;
|
||||
isLoading: boolean;
|
||||
createdAt: string;
|
||||
comment: string | undefined;
|
||||
@@ -108,6 +111,7 @@ const Comment = ({
|
||||
size="sm"
|
||||
name={name ?? ""}
|
||||
email={email ?? ""}
|
||||
imageUrl={getAvatarUrl(image) || undefined}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user