From d2bfdb5233dde284a2fcab84e8004a213cc18273 Mon Sep 17 00:00:00 2001 From: steward379 Date: Sun, 10 Dec 2023 05:04:21 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=F0=9F=8C=9F=20Add=20tags=20Display=20?= =?UTF-8?q?to=20userMap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MapCard.tsx | 2 +- src/pages/user-maps/[userId].tsx | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/MapCard.tsx b/src/components/MapCard.tsx index 48b523f..98a5474 100644 --- a/src/components/MapCard.tsx +++ b/src/components/MapCard.tsx @@ -22,7 +22,7 @@ const MapCard = ({ map, userId, isCurrentUser = false }) => {

{map.title}

by {map.authorName}

-
+
{(map.tags || []).map((tag, index) => ( {tag} diff --git a/src/pages/user-maps/[userId].tsx b/src/pages/user-maps/[userId].tsx index 7c6e2b8..d04a25c 100644 --- a/src/pages/user-maps/[userId].tsx +++ b/src/pages/user-maps/[userId].tsx @@ -52,7 +52,7 @@ const UserMapsPage = () => { id: likedMapsIds[index].id, ...mapSnap.data(), authorId: likedMapsIds[index].authorId, - authorName: authorSnap.data().name // 或其他你需要的作者信息 + authorName: authorSnap.data().name }; } return null; @@ -237,6 +237,13 @@ const UserMapsPage = () => { )}

{map.title}

+
+ {(map.tags || []).map((tag, index) => ( + + {tag} + + ))} +

{formatDate(map.publishDate)}

@@ -261,6 +268,13 @@ const UserMapsPage = () => {

{`${map.title}`}

{`${map.authorName}`}

+
+ {(map.tags || []).map((tag, index) => ( + + {tag} + + ))} +

{formatDate(map.publishDate)}