fix: hide download button on favorites cards
All checks were successful
Deploy Staging (terry-wallet-login) / deploy (push) Successful in 1m8s
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:
@@ -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}
|
||||
|
||||
@@ -200,6 +200,7 @@ export default function Favorites() {
|
||||
categories={categories}
|
||||
browseSort=""
|
||||
showRank={false}
|
||||
showDownload={false}
|
||||
singlePostLink
|
||||
onFavoriteChange={(_, favorited) => {
|
||||
if (!favorited) setReloadKey((value) => value + 1);
|
||||
|
||||
Reference in New Issue
Block a user