Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centrifuge App: Fix formatting for investor transactions #1686

Merged
merged 2 commits into from
Nov 15, 2023
Merged
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
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
Loading