From 21fe3f5e5c1f846bda79680355f1191a133b059e Mon Sep 17 00:00:00 2001 From: Zeck Li <11781254+zeckli@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:52:44 +0800 Subject: [PATCH] feat(bids): replace dates in bids list with updatedAt --- app/routes/api.bids.ts | 10 +++++----- app/routes/showcase/Bids/Records/Record/index.tsx | 4 ++-- app/routes/showcase/Bids/Records/index.tsx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/routes/api.bids.ts b/app/routes/api.bids.ts index 2cee75f..59a9e99 100644 --- a/app/routes/api.bids.ts +++ b/app/routes/api.bids.ts @@ -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, @@ -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, }) } diff --git a/app/routes/showcase/Bids/Records/Record/index.tsx b/app/routes/showcase/Bids/Records/Record/index.tsx index 899fcec..404c514 100644 --- a/app/routes/showcase/Bids/Records/Record/index.tsx +++ b/app/routes/showcase/Bids/Records/Record/index.tsx @@ -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' @@ -32,7 +32,7 @@ const Record = ({ bid, isHighest }: Props) => { USDT