feat: add BaseUserAvatar and unify avatar usage

This commit is contained in:
Tim
2025-09-24 00:26:51 +08:00
parent 26d1db79f4
commit efbb83924b
15 changed files with 263 additions and 91 deletions

View File

@@ -199,6 +199,8 @@ function createFetchNotifications() {
arr.push({
...n,
src: n.comment.author.avatar,
userId: n.comment.author.id,
userName: n.comment.author.username,
iconClick: () => {
markNotificationRead(n.id)
navigateTo(`/users/${n.comment.author.id}`, { replace: true })
@@ -219,6 +221,8 @@ function createFetchNotifications() {
arr.push({
...n,
src: n.fromUser ? n.fromUser.avatar : null,
userId: n.fromUser ? n.fromUser.id : undefined,
userName: n.fromUser ? n.fromUser.username : undefined,
icon: n.fromUser ? undefined : iconMap[n.type],
iconClick: () => {
if (n.fromUser) {
@@ -231,6 +235,8 @@ function createFetchNotifications() {
arr.push({
...n,
src: n.fromUser ? n.fromUser.avatar : null,
userId: n.fromUser ? n.fromUser.id : undefined,
userName: n.fromUser ? n.fromUser.username : undefined,
icon: n.fromUser ? undefined : iconMap[n.type],
iconClick: () => {
if (n.fromUser) {
@@ -269,6 +275,8 @@ function createFetchNotifications() {
arr.push({
...n,
src: n.comment.author.avatar,
userId: n.comment.author.id,
userName: n.comment.author.username,
iconClick: () => {
markNotificationRead(n.id)
navigateTo(`/users/${n.comment.author.id}`, { replace: true })
@@ -315,6 +323,8 @@ function createFetchNotifications() {
arr.push({
...n,
src: n.fromUser ? n.fromUser.avatar : null,
userId: n.fromUser ? n.fromUser.id : undefined,
userName: n.fromUser ? n.fromUser.username : undefined,
icon: n.fromUser ? undefined : iconMap[n.type],
iconClick: () => {
if (n.post) {