Skip to content

Commit

Permalink
fix broken table
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom committed Jan 19, 2024
1 parent 62a0a0f commit 3c76050
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ export function ReportTable({
});

const renderItem = useCallback(
({ item, groupByItem, mode, style, key, monthsCount }) => {
({ item, groupByItem, mode, style, monthsCount }) => {
return (
<ReportTableRow
key={key}
item={item}
balanceTypeOp={balanceTypeOp}
groupByItem={groupByItem}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,20 @@ export function ReportTableList({
const groupByItem = ['Month', 'Year'].includes(groupBy) ? 'date' : 'name';

type RenderRowProps = {
key: string;
index: number;
parent_index?: number;
style?: CSSProperties;
};
function RenderRow({ index, parent_index, style, key }: RenderRowProps) {
const item = parent_index
? data[parent_index].categories[index]
: data[index];
function RenderRow({ index, parent_index, style }: RenderRowProps) {
const item = parent_index === undefined

Check warning on line 35 in packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableList.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎·····`
? data[index]

Check warning on line 36 in packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableList.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
: data[parent_index].categories[index];

Check warning on line 37 in packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableList.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`

return renderItem({
item,
groupByItem,
mode,
style,
key,
monthsCount,
});
}
Expand All @@ -55,7 +53,6 @@ export function ReportTableList({
{data ? (
<>
<RenderRow
key={item.id}
index={index}
style={
item.categories && {
Expand All @@ -71,7 +68,6 @@ export function ReportTableList({
{item.categories.map((category, i) => {
return (

Check warning on line 69 in packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableList.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `(⏎··························<RenderRow⏎····························index={i}⏎····························parent_index={index}⏎··························/>⏎························)` with `<RenderRow·index={i}·parent_index={index}·/>`
<RenderRow

Check failure on line 70 in packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableList.tsx

View workflow job for this annotation

GitHub Actions / lint

Missing "key" prop for element in iterator
key={category.id}
index={i}
parent_index={index}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const ReportTableRow = memo(
const average = amountToInteger(item[balanceTypeOp]) / monthsCount;
return (
<Row
key={item.id}
collapsed={true}
style={{
color: theme.tableText,
Expand Down

0 comments on commit 3c76050

Please sign in to comment.