Skip to content

Commit

Permalink
feat: date --> timeAgo
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanjoshi914 committed Jan 10, 2025
1 parent a54914e commit 40b374a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/app/components/TransactionsTable/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const transactions: Props = {
{
timestamp: 1656573909064,
createdAt: "1656573909064",
date: "5 days ago",
timeAgo: "5 days ago",
description: "Polar Invoice for bob",
host: "https://openai.com/dall-e-2/",
id: "1",
Expand All @@ -49,7 +49,7 @@ const invoices: Props = {
totalAmountFiat: "$13.02",
preimage: "",
title: "lambo lambo",
date: "4 days ago",
timeAgo: "4 days ago",
},
{
id: "lnbcrt6543210n1p3tadjepp5rv6ufq4vumg66l9gcyxqhy89n6w90mx0mh6gcj0sawrf6xuep5ssdq5g9kxy7fqd9h8vmmfvdjscqzpgxqyz5vqsp5f9yzxeqjw33ule4rffuh0py32gjjsx8z48cd4xjl8ej3rn7zdtdq9qyyssqe6qvkfe260myc9ypgs5n63xzwcx82fderg8p5ysh6c2fvpz5xu4ksvhs5av0wwestk5pmucmhk8lpjhmy7wqyq9c29xgm9na2q5xv5spy5kukj",
Expand All @@ -59,7 +59,7 @@ const invoices: Props = {
totalAmountFiat: "$127.80",
preimage: "",
title: "Alby invoice",
date: "6 days ago",
timeAgo: "6 days ago",
},
],
};
Expand All @@ -74,7 +74,7 @@ const invoicesWithBoostagram: Props = {
totalAmountFiat: "$13.02",
preimage: "",
title: "lambo lambo",
date: "4 days ago",
timeAgo: "4 days ago",
},
{
id: "lnbcrt888880n1p3tad30pp56j6g34wctydrfx4wwdwj3schell8uqug6jnlehlkpw02mdfd9wlqdq0v36k6urvd9hxwuccqzpgxqyz5vqsp5995q4egstsvnyetwvpax6jw8q0fnn4tyz3gp35k3yex29emhsylq9qyyssq0yxpx6peyn4vsepwj3l68w9sc5dqnkt07zff6aw4kqvcfs0fpu4jpfh929w6vqrgtjfkmrlwghq4s9t4mnwrh4dlkm6wjem5uq8eu4gpwqln0j",
Expand All @@ -84,7 +84,7 @@ const invoicesWithBoostagram: Props = {
totalAmountFiat: "$17.36",
preimage: "",
title: "dumplings",
date: "5 days ago",
timeAgo: "5 days ago",
boostagram: {
app_name: "Fountain",
name: "Friedemann",
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/TransactionsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function TransactionsTable({
</p>
</div>
<p className="text-xs text-gray-400 dark:text-neutral-500">
{tx.date}
{tx.timeAgo}
</p>
</div>
<div className="flex ml-auto text-right space-x-3 shrink-0 dark:text-white">
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/useTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useTransactions = () => {
(transaction) => ({
...transaction,
title: transaction.memo,
date: dayjs(
timeAgo: dayjs(
transaction.settleDate || transaction.creationDate
).fromNow(),
timestamp: transaction.settleDate || transaction.creationDate,
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const convertPaymentToTransaction = (
...payment,
id: `${payment.id}`,
type: "sent",
date: dayjs(+payment.createdAt).fromNow(),
timeAgo: dayjs(+payment.createdAt).fromNow(),
title: payment.description || payment.name,
publisherLink: publisherLink || payment.location,
timestamp: parseInt(payment.createdAt),
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ export type Transaction = {
boostagram?: Invoice["boostagram"];
createdAt?: string;
currency?: string;
date: string;
timeAgo: string;
paymentHash?: string;
description?: string;
host?: string;
Expand Down

0 comments on commit 40b374a

Please sign in to comment.