Skip to content

Commit

Permalink
[explorer] - fix UI display for missing timestamp in tx (MystenLabs#1…
Browse files Browse the repository at this point in the history
…0923)

## Description 

Fixes displaying "0" when timestamp was empty

## Test Plan 

How did you test the new or updated feature?

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
mamos-mysten authored Apr 17, 2023
1 parent 3865ff4 commit 9a75179
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions apps/explorer/src/pages/transaction-result/TransactionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,14 @@ export function TransactionView({
<StatAmount
amount={formattedAmount}
symbol={symbol}
date={Number(timestamp ?? 0)}
date={Number(timestamp)}
/>
</section>
) : (
timestamp && (
<div className="mb-3">
<DateCard
date={Number(timestamp ?? 0)}
/>
</div>
)
)}
) : timestamp ? (
<div className="mb-3">
<DateCard date={Number(timestamp)} />
</div>
) : null}
{isSponsoredTransaction && (
<div className="mt-10">
<SponsorTransactionAddress
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/src/ui/StatAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function StatAmount({ dollarAmount, date, ...props }: StatAmountProps) {
return (
<div className="flex flex-col justify-start gap-2 text-gray-75">
<div className="flex flex-col items-baseline gap-2.5 text-gray-100">
{date && <DateCard date={date} />}
{date ? <DateCard date={date} /> : null}
<div className="flex flex-col items-baseline gap-2.5">
<Heading
as="h4"
Expand Down

0 comments on commit 9a75179

Please sign in to comment.