on master help sign in
ux: user can hover short date to see full date
commitc3c8a371e94506ada0b90d7f822ebb40d6bcc8c4 authortomholford <tomholford@users.noreply.github.com> dateTue 12 Oct 2021, 10:13 (5 years ago) parente2e39d7
1 file changed+22−5
src/views/Transactions/TransactionRow.tsx+22−5
src/views/Transactions/TransactionRow.tsx+22−5
@@ -32,15 +32,30 @@ export const TransactionRow = ({
3232 return abbreviateAddress(hash);
3333 }, [hash]);
3434
35− const shortDate = useMemo(() => {
35+ const parsedDate = useMemo(() => {
3636 if (!time) {
3737 return null;
3838 }
39− const d = fromUnixTime(time / 1000);
40− console.log(d.toLocaleTimeString());
41− return format(d, 'MMMM dd');
39+
40+ return fromUnixTime(time / 1000);
4241 }, [time]);
4342
43+ const shortDate = useMemo(() => {
44+ if (!parsedDate) {
45+ return null;
46+ }
47+
48+ return format(parsedDate, 'MMMM dd');
49+ }, [parsedDate]);
50+
51+ const longDate = useMemo(() => {
52+ if (!parsedDate) {
53+ return null;
54+ }
55+
56+ return parsedDate.toISOString();
57+ }, [parsedDate]);
58+
4459 const statusBadge = useMemo(() => {
4560 return (
4661 <div className={cn(['badge', status])}>
@@ -62,7 +77,9 @@ export const TransactionRow = ({
6277 </Row>
6378 <Row className="info-row">
6479 <Box className="hash">{shortHash}</Box>
65− <Box className="date">{shortDate}</Box>
80+ <Box className="date" title={longDate}>
81+ {shortDate}
82+ </Box>
6683 </Row>
6784 </Box>
6885 </Box>