diff --git a/centrifuge-app/src/components/Charts/PoolPerformanceChart.tsx b/centrifuge-app/src/components/Charts/PoolPerformanceChart.tsx index bad3411b0..90a754f7b 100644 --- a/centrifuge-app/src/components/Charts/PoolPerformanceChart.tsx +++ b/centrifuge-app/src/components/Charts/PoolPerformanceChart.tsx @@ -221,7 +221,6 @@ function PoolPerformanceChart() { return result } - return ( @@ -501,8 +500,9 @@ function CustomLegend({ ) } -const CustomTick = ({ x, y, payload }: any) => { +export const CustomTick = ({ x, y, payload }: any) => { const theme = useTheme() + return ( { + const theme = useTheme() + + const getOneDayPerMonth = () => { + const seenMonths = new Set() + const result: string[] = [] + + data.forEach((item) => { + const date = new Date(item.name) + const month = date.getMonth() + 1 + const year = date.getFullYear() + const monthYear = `${year}-${month}` + + if (!seenMonths.has(monthYear)) { + seenMonths.add(monthYear) + result.push(item.name) + } + }) + + return result + } + + if (!data.length) + return ( + + No data available + + ) + + return ( + + + + + } + angle={45} + /> + { + const balance = new CurrencyBalance(tick, currency?.decimals || 0) + return formatBalanceAbbreviated(balance, '', 0) + }} + tick={{ fontSize: 10, color: theme.colors.textPrimary }} + tickLine={false} + axisLine={false} + dataKey="yAxis" + /> + + + { + if (payload && payload?.length > 0) { + return ( + + {formatDate(payload[0].payload.name)} + {payload.map((item) => ( + {formatBalance(item.value as number, currency)} + ))} + + ) + } + }} + /> + + + + + ) +} diff --git a/centrifuge-app/src/components/DataTable.tsx b/centrifuge-app/src/components/DataTable.tsx index 0ae6b99f0..c852234dd 100644 --- a/centrifuge-app/src/components/DataTable.tsx +++ b/centrifuge-app/src/components/DataTable.tsx @@ -60,6 +60,7 @@ export type Column = { align?: string sortKey?: string width?: string + isLabel?: boolean } const sorter = >(data: Array, order: OrderBy, sortKey?: string) => { if (!sortKey) return data @@ -149,33 +150,36 @@ export const DataTable = >({ tabIndex={onRowClicked ? 0 : undefined} > {columns.map((col, index) => ( - - {col.cell(row, i)} - - ))} - - ))} - {sortedAndPaginatedData?.map((row, i) => ( - - {columns.map((col, index) => ( - + {col.cell(row, i)} ))} ))} + {sortedAndPaginatedData?.map((row, i) => { + return ( + + {columns.map((col, index) => ( + + {col.cell(row, i)} + + ))} + + ) + })} {/* summary row is not included in sorting */} {summary && ( @@ -241,8 +245,8 @@ export const DataRow = styled(Row)` })} ` -export const DataCol = styled(Text)<{ align: Column['align'] }>` - background: initial; +export const DataCol = styled(Text)<{ align: Column['align']; isLabel?: boolean }>` + background: ${({ isLabel, theme }) => (isLabel ? theme.colors.backgroundSecondary : 'initial')}; border: none; padding: 8px 16px; display: flex; diff --git a/centrifuge-app/src/components/IssuerSection.tsx b/centrifuge-app/src/components/IssuerSection.tsx index 1388461e0..b5238987d 100644 --- a/centrifuge-app/src/components/IssuerSection.tsx +++ b/centrifuge-app/src/components/IssuerSection.tsx @@ -28,9 +28,9 @@ type IssuerSectionProps = { } const reportLinks = [ - { label: 'Balance sheet', href: '/balance-sheet', icon: }, - { label: 'Profit & loss', href: '/profit-and-loss', icon: }, - { label: 'Cashflow statement', href: '/cash-flow-statement', icon: }, + { label: 'Balance sheet', href: '/balance-sheet', icon: }, + { label: 'Profit & loss', href: '/profit-and-loss', icon: }, + { label: 'Cashflow statement', href: '/cash-flow-statement', icon: }, ] const StyledRouterTextLink = styled(RouterTextLink)` @@ -78,7 +78,7 @@ export function ReportDetails({ metadata }: IssuerSectionProps) { {link.label} - + ))} diff --git a/centrifuge-app/src/components/LayoutBase/index.tsx b/centrifuge-app/src/components/LayoutBase/index.tsx index b8de592ca..db5cd3088 100644 --- a/centrifuge-app/src/components/LayoutBase/index.tsx +++ b/centrifuge-app/src/components/LayoutBase/index.tsx @@ -12,6 +12,7 @@ import { FooterContainer, Inner, LogoContainer, + MobileBar, Root, ToolbarContainer, WalletContainer, @@ -30,19 +31,30 @@ export function LayoutBase(): JSX.Element { - - - - - - - - {isMedium && ( + {isMedium ? ( + + + + + + +