fix: hide download button on favorites cards
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m8s

Add `showDownload` prop to PopularRankRow (default true to keep Home popular cards unchanged) and pass `showDownload={false}` from the favorites list.
This commit is contained in:
TerryM
2026-06-05 19:31:27 +08:00
parent 3275aff121
commit 69bef7ee6e
2 changed files with 4 additions and 1 deletions

View File

@@ -89,6 +89,7 @@ export function PopularRankRow({
categories,
browseSort = "popular",
showRank = true,
showDownload = true,
singlePostLink = false,
onFavoriteChange,
}: {
@@ -97,6 +98,7 @@ export function PopularRankRow({
categories: Category[];
browseSort?: string;
showRank?: boolean;
showDownload?: boolean;
singlePostLink?: boolean;
onFavoriteChange?: (postId: string, favorited: boolean) => void;
}) {
@@ -211,7 +213,7 @@ export function PopularRankRow({
onFavoriteChange?.(post.id, favorited)
}
/>
{r.isDownloadable ? (
{showDownload && r.isDownloadable ? (
<button
type="button"
onClick={handleDownload}

View File

@@ -200,6 +200,7 @@ export default function Favorites() {
categories={categories}
browseSort=""
showRank={false}
showDownload={false}
singlePostLink
onFavoriteChange={(_, favorited) => {
if (!favorited) setReloadKey((value) => value + 1);