Skip to content

Commit

Permalink
Merge pull request #64 from thematters/develop
Browse files Browse the repository at this point in the history
Update main branch for updating bids list
  • Loading branch information
zeckli authored Aug 30, 2024
2 parents 6c498ad + 9e628fd commit f0c5596
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions app/routes/api.bids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
continue
}

const [placedAtTime, events] = await Promise.all([
alchemy.core.getBlock(Number(bid.placedAt)),
const [updatedAtTime, events] = await Promise.all([
alchemy.core.getBlock(Number(bid.updatedAt)),
getBidUpdatedEvents(
client,
addressRegistry,
Expand All @@ -104,15 +104,15 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
currBlock
),
])
const placedAt = genUTC8Date(placedAtTime.timestamp * 1000)
const updatedAt = genUTC8Date(updatedAtTime.timestamp * 1000)
const tx = maxBy(events, (d) => Number(d.args.price))
const txHash = tx?.transactionHash || ''

bids.push({
bidder,
price: Number(bid.price).toFixed(0),
placedAt,
placedAtTime: placedAtTime.timestamp,
updatedAt,
updatedAtTime: updatedAtTime.timestamp,
txHash,
})
}
Expand Down
4 changes: 2 additions & 2 deletions app/routes/showcase/Bids/Records/Record/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Props = {
}

const Record = ({ bid, isHighest }: Props) => {
const { price, bidder, placedAt, txHash, link } = bid
const { price, bidder, updatedAt, txHash, link } = bid

const baseCss = 'px-2 py-4 md:px-4 cols-4 gap-x-4 t-12 md:t-14'
const borderCss = 'tab-border after:-right-2 after:border-green'
Expand All @@ -32,7 +32,7 @@ const Record = ({ bid, isHighest }: Props) => {
USDT
</div>
<div className={cellCss}>{bidder}</div>
<div className={cellCss}>{placedAt}</div>
<div className={cellCss}>{updatedAt}</div>
<div className="f-center-start">
<NavLink className={linkCss} to={link} target="_blank">
{txHash}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/showcase/Bids/Records/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Records = ({ data }: Props) => {
},
{ bids: [], highestBid: [] }
)
const orderedBids = orderBy(bidsData.bids, ['placedAtTime'], ['desc'])
const orderedBids = orderBy(bidsData.bids, ['updatedAtTime'], ['desc'])

const isEmpty = !rawBids || rawBids.length == 0

Expand Down

0 comments on commit f0c5596

Please sign in to comment.