Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions src/components/request-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import {
} from '@/components/ui/table';
import { Transaction } from '@/lib/types';
import TimeAgo from 'timeago-react';
import { formatTimestamp, getAmountWithCurrencySymbol } from '@/lib/utils';
import {
calculateShortPaymentReference,
formatTimestamp,
getAmountWithCurrencySymbol,
} from '@/lib/utils';
import Link from 'next/link';
import truncateEthAddress from 'truncate-eth-address';
import { Dispatch, SetStateAction } from 'react';
Expand All @@ -41,9 +45,22 @@ export const columns: ColumnDef<Transaction>[] = [
</div>
),
},
{
accessorKey: 'paymentReference',
header: 'Payment Reference',
cell: ({ row }) => {
return calculateShortPaymentReference(
row.original.channelId,
row.original?.dataObject.data.parameters.extensionsData[0].parameters
.salt || '',
row.original?.dataObject.data.parameters.extensionsData[0].parameters
.paymentAddress || '',
);
},
},
{
accessorKey: 'blockTimestamp',
header: 'Timestamp',
header: 'Created',
cell: ({ row }) => (
<div className="lowercase">
<TimeAgo
Expand All @@ -59,15 +76,32 @@ export const columns: ColumnDef<Transaction>[] = [
header: 'Payee',
cell: ({ row }: { row: any }) => {
const address = row.original?.dataObject?.data?.parameters?.payee?.value;
return address ? truncateEthAddress(address) : 'N/A';

return address ? (
<div className="font-medium text-emerald-700">
<Link href={`/address/${address}`}>
{truncateEthAddress(address)}
</Link>
</div>
) : (
'N/A'
);
},
},
{
accessorKey: 'payer',
header: 'Payer',
cell: ({ row }: { row: any }) => {
const address = row.original?.dataObject?.data?.parameters?.payer?.value;
return address ? truncateEthAddress(address) : 'N/A';
return address ? (
<div className="font-medium text-emerald-700">
<Link href={`/address/${address}`}>
{truncateEthAddress(address)}
</Link>
</div>
) : (
'N/A'
);
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/stats-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function StatsArea() {
<DollarSign className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">$700+ Million</div>
<div className="text-2xl font-bold">$800+ Million</div>
</CardContent>
</Card>
<Card>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const CHAIN_SCAN_URLS = {
[CHAINS.MOONBEAM]: 'https://moonbeam-explorer.netlify.app',
[CHAINS.OPTIMISM]: 'https://optimistic.etherscan.io',
[CHAINS.SEPOLIA]: 'https://sepolia.etherscan.io',
[CHAINS.XDAI]: 'https://blockscout.com/xdai/mainnet',
[CHAINS.XDAI]: 'https://gnosisscan.io',
[CHAINS.ZKSYNCERA]: 'https://explorer.zksync.io',
};

Expand Down
4 changes: 2 additions & 2 deletions src/lib/hooks/use-export-pdf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function useExportPDF() {
<head>
</head>
<body>
<div id="invoice" style="max-width: 800px; margin: 0 auto; padding: 20px;">
<div id="invoice" style="max-width: 800px; margin: 0 auto; padding: 5px;">
<div style="display: flex; justify-content: space-between; align-items: start;">
<div style="text-align: right;">
<p>Issued on ${formatDate(invoice?.creationDate)}</p>
Expand All @@ -83,7 +83,7 @@ export default function useExportPDF() {
invoice?.invoiceNumber || '-'
}</h1>

<div style="display: flex; justify-content: space-between; margin-bottom: 20px; background-color: #FBFBFB; padding: 10px;">
<div style="display: flex; justify-content: space-between; margin-bottom: 20px; background-color: #FBFBFB; padding: 5px; gap:2%;">
<div>
<strong>From:</strong><br>
<p style="font-size: 14px">${invoice.payee?.value || '-'}</p>
Expand Down