From 706aed998eca937890f65e1fb331fd4030474bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E4=BD=A9=E5=BA=AD?= Date: Sat, 19 Jul 2025 22:11:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=84=AA=E5=8C=96=E6=89=8B=E6=A9=9F=E4=BB=8B?= =?UTF-8?q?=E9=9D=A2=E5=91=88=E7=8F=BE=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/wishes/page.tsx | 2 +- components/wish-card.tsx | 79 ++++++++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/app/wishes/page.tsx b/app/wishes/page.tsx index fc83776..5a51d02 100644 --- a/app/wishes/page.tsx +++ b/app/wishes/page.tsx @@ -191,7 +191,7 @@ export default function WishesPage() { // 分頁相關狀態 const [currentPage, setCurrentPage] = useState(1) - const [itemsPerPage] = useState(5) + const [itemsPerPage] = useState(3) const [paginatedWishes, setPaginatedWishes] = useState([]) const [totalPages, setTotalPages] = useState(0) diff --git a/components/wish-card.tsx b/components/wish-card.tsx index dfa217a..0ea3e31 100644 --- a/components/wish-card.tsx +++ b/components/wish-card.tsx @@ -279,20 +279,31 @@ export default function WishCard({ wish }: WishCardProps) {
-
-
-
- - - {likeCount > 0 ? `${likeCount} 人也遇到相同問題` : "成為第一個表達支持的人"} + {/* 手機端優化:改為上下布局避免擠壓 */} +
+ {/* 第一行:支持數量和愛心顯示 */} +
+
+ + + {likeCount > 0 ? ( + {likeCount} 人也遇到 + ) : ( + 成為第一個支持者 + )} + + {likeCount > 0 ? `${likeCount} 人也遇到相同問題` : "成為第一個表達支持的人"} +
+ + {/* 愛心動畫區域 - 手機端縮小 */} {likeCount > 0 && ( -
+
{[...Array(Math.min(likeCount, 5))].map((_, i) => ( @@ -302,30 +313,34 @@ export default function WishCard({ wish }: WishCardProps) { )}
- + {/* 第二行:按讚按鈕 - 手機端更緊湊 */} +
+ +
{hasLiked && (