Skip to content

Commit

Permalink
chore: update collection image on homepage and collection page
Browse files Browse the repository at this point in the history
  • Loading branch information
itttm127 authored and reinamora137 committed Feb 12, 2025
1 parent 0e6d57c commit fc87c85
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 5 additions & 1 deletion components/collection/CollectionListCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export function CollectionListCard(
>
<div
class={`${imageContentClassName} ${isHovered ? "grayscale-0" : ""}`}
style={{ backgroundImage: `url('${collection.first_stamp_image}')` }}
style={{
backgroundImage: `url('${
collection.first_stamp_image || collection.img
}')`,
}}
>
</div>
<div
Expand Down
2 changes: 1 addition & 1 deletion components/collection/CollectionOverviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function CollectionOverviewCard(
"text-sm mobileLg:text-base font-light text-stamp-grey-darker uppercase";
const dataValueSm =
"text-sm mobileLg:text-base font-medium text-stamp-grey-light";
console.log("collection====>", collection);

return (
<a
href={`/collection/details/${collection.collection_name}`}
Expand Down
2 changes: 1 addition & 1 deletion islands/home/HomeStampPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function HomeStampPreview({
"desktop": 3, // 3 columns x 1 rows
},
};

console.log(stamps_art, stamps_posh, stamps_src721, collectionData);
return (
<div className="
flex flex-col gap-12 mobileLg:gap-24 desktop:gap-36
Expand Down
13 changes: 12 additions & 1 deletion server/controller/stampController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,24 @@ export class StampController {
});
poshStamps = poshResult.data;
}
const collectionData = []
await Promise.all(
collections?.data.map(async (item) => {
const result = await this.getStamps({
collectionId: item.collection_id,
ident: ["STAMP", "SRC-721", "SRC-20"],
sortBy: "DESC"
});
collectionData.push({ ...item, img: result.data?.[0]?.stamp_url });
}),
);

return {
carouselStamps: carouselData.data ?? [],
stamps_src721: mainCategories[1]?.stamps ?? [],
stamps_art: mainCategories[2]?.stamps ?? [], // Now at index 2
stamps_posh: poshStamps,
collectionData: collections.data ?? [],
collectionData: collectionData ?? [],
};

} catch (error) {
Expand Down

0 comments on commit fc87c85

Please sign in to comment.