Skip to content

Commit

Permalink
CR fixes v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ikprk committed Jul 15, 2024
1 parent 435cf42 commit 18bfd04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions packages/atlas/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export const Table = <T extends object>({
{data.length ? (
<TableWrapper ref={scrollRef} onMouseDown={onMouseDown}>
<PageWrapper minWidth={minWidth}>
{page.map((subpage, idx) => (
<TableBase className="table-base" {...getTableProps()} key={`table-slice-${idx}`}>
{page.map((subpage, subpageIdx) => (
<TableBase className="table-base" {...getTableProps()} key={`table-slice-${subpageIdx}`}>
<Thead className="table-header">
{headerGroups.map((headerGroup) => (
<tr {...headerGroup.getHeaderGroupProps()} key={headerGroup.getHeaderGroupProps().key}>
Expand Down Expand Up @@ -174,7 +174,8 @@ export const Table = <T extends object>({
<tbody {...getTableBodyProps()}>
{subpage.map((row, idx) => {
prepareRow(row)
const rowTo = getRowTo ? getRowTo(idx) : undefined
const realRowIndex = page[0].length * subpageIdx + idx
const rowTo = getRowTo ? getRowTo(realRowIndex) : undefined
const mappedCells = row.cells.map((cell) => (
<Td
variant="t100"
Expand All @@ -192,7 +193,9 @@ export const Table = <T extends object>({
<AnchorRow
className="table-row"
{...row.getRowProps()}
onClick={() => onRowClick?.(idx)}
onClick={() => {
onRowClick?.(realRowIndex)
}}
key={row.getRowProps().key}
to={rowTo}
>
Expand All @@ -205,7 +208,9 @@ export const Table = <T extends object>({
<tr
className="table-row"
{...row.getRowProps()}
onClick={() => onRowClick?.(idx)}
onClick={() => {
onRowClick?.(realRowIndex)
}}
key={row.getRowProps().key}
>
{mappedCells}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export const CrtMarketplaceView = () => {

<TableFullWitdhtWrapper>
<LimitedWidthContainer big noBottomPadding>
<HotCreatorTokens interval={30} tableTitle="Hot tokens" />
<HotCreatorTokens interval={30} tableTitle="Hot Tokens" />
</LimitedWidthContainer>
</TableFullWitdhtWrapper>

<TableFullWitdhtWrapper>
<LimitedWidthContainer big noBottomPadding>
<TopMovingTokens interval={30} tableTitle="Top Gainers" />
<TopMovingTokens interval={30} tableTitle="Top Movers" />
</LimitedWidthContainer>
</TableFullWitdhtWrapper>

Expand Down

0 comments on commit 18bfd04

Please sign in to comment.