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

View File

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