Skip to content

Commit

Permalink
fix: add releaseDate to partner card (#4315)
Browse files Browse the repository at this point in the history
* fix: complete todo

* fix: findLast alternative
  • Loading branch information
ColinBuyck authored Sep 13, 2024
1 parent ceed376 commit 157704f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sites/partners/src/pages/listings/[id]/lottery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ const Lottery = (props: { listing: Listing | undefined }) => {
(event) => event.type === ListingEventsTypeEnum.publicLottery
)
if (listing.lotteryStatus === LotteryStatusEnum.releasedToPartners) {
// reverse array to find most recent release date
const lotteryReleaseDate = lotteryActivityLogData
?.reverse()
?.find((logItem) => logItem.status === LotteryStatusEnum.releasedToPartners)?.logDate
return (
<CardSection>
<Icon size="xl">
Expand All @@ -211,8 +215,8 @@ const Lottery = (props: { listing: Listing | undefined }) => {
<p>
{t("listings.lottery.partnerPublishTimestamp", {
adminName: t("listings.lottery.partnerPublishTimestampAdmin"),
date: "DATE",
time: "TIME",
date: dayjs(lotteryReleaseDate).format("MM/DD/YYYY"),
time: dayjs(lotteryReleaseDate).format("h:mm a"),
portal: t("listings.lottery.partnerPublishTimestampPortal"),
})}
</p>
Expand Down

0 comments on commit 157704f

Please sign in to comment.