Wallet history timestamps (#585)

* Show when wallet history facts occurred

make use of the `timeSince` function that we use in item components
to show a relative time that a wallet history event occurred.

you an also hover over the relative time to see the ISO timestamp.

* Add `suppressHydrationWarning` to avoid hydration issues in dev mode

* Display date/time instead of relative time since
This commit is contained in:
SatsAllDay 2023-10-25 14:06:15 -04:00 committed by GitHub
parent 64cf40a04c
commit 843774183b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -137,11 +137,13 @@ function Detail ({ fact }) {
}
function Fact ({ fact }) {
const factDate = new Date(fact.createdAt)
return (
<>
<div className={`${styles.type} ${satusClass(fact.status)} ${fact.sats > 0 ? '' : 'text-muted'}`}>{fact.type}</div>
<div className={styles.detail}>
<Detail fact={fact} />
<div className='text-muted px-3'>{`${factDate.toLocaleDateString()} ${factDate.toLocaleTimeString()}`}</div>
</div>
<div className={`${styles.sats} ${satusClass(fact.status)} ${fact.sats > 0 ? '' : 'text-muted'}`}>{fact.sats}</div>
</>