Skip to content

Commit

Permalink
Centrifuge App: Fix formatting for investor transactions (#1686)
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser authored Nov 15, 2023
1 parent 1406e5b commit d15638f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions centrifuge-app/src/components/Report/InvestorTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function truncate(string: string) {
return `${first}...${last}`
}

const noop = (v: any) => v
const cellFormatters = [noop, truncate, noop, noop, noop, noop, noop, noop]

export function InvestorTransactions({ pool }: { pool: Pool }) {
const { activeTranche, setCsvData, startDate, endDate } = React.useContext(ReportContext)

Expand All @@ -43,7 +46,7 @@ export function InvestorTransactions({ pool }: { pool: Pool }) {
const columns = headers.map((col, index) => ({
align: 'left',
header: col,
cell: (row: TableDataRow) => <Text variant="body2">{(row.value as any)[index]}</Text>,
cell: (row: TableDataRow) => <Text variant="body2">{cellFormatters[index]((row.value as any)[index])}</Text>,
}))

const data: TableDataRow[] = React.useMemo(() => {
Expand All @@ -59,7 +62,7 @@ export function InvestorTransactions({ pool }: { pool: Pool }) {
name: '',
value: [
token.currency.name,
truncate(tx.accountId),
tx.accountId,
tx.epochNumber.toString(),
formatDate(tx.timestamp.toString()),
formatInvestorTransactionsType({
Expand Down

0 comments on commit d15638f

Please sign in to comment.