-
-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* TS strict changes * notes * renderRowProps * RenderTableRow
- Loading branch information
Showing
20 changed files
with
253 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 24 additions & 10 deletions
34
packages/desktop-client/src/components/reports/graphs/adjustTextSize.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/desktop-client/src/components/reports/graphs/tableGraph/RenderTableRow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React, { type ReactNode } from 'react'; | ||
|
||
import { type GroupedEntity } from 'loot-core/src/types/models/reports'; | ||
|
||
import { type CSSProperties } from '../../../../style'; | ||
import { View } from '../../../common/View'; | ||
|
||
import { type renderRowProps } from './ReportTable'; | ||
|
||
type RenderTableRowProps = { | ||
index: number; | ||
parent_index?: number; | ||
compact: boolean; | ||
renderRow: (arg: renderRowProps) => ReactNode; | ||
intervalsCount: number; | ||
mode: string; | ||
metadata: GroupedEntity[]; | ||
style?: CSSProperties; | ||
compactStyle?: CSSProperties; | ||
}; | ||
|
||
export function RenderTableRow({ | ||
index, | ||
parent_index, | ||
compact, | ||
renderRow, | ||
intervalsCount, | ||
mode, | ||
metadata, | ||
style, | ||
compactStyle, | ||
}: RenderTableRowProps) { | ||
const child = metadata[index]; | ||
const parent = | ||
parent_index !== undefined ? metadata[parent_index] : ({} as GroupedEntity); | ||
|
||
const item = | ||
parent_index === undefined | ||
? child | ||
: (parent.categories && parent.categories[index]) || | ||
({} as GroupedEntity); | ||
|
||
return ( | ||
<View> | ||
{renderRow({ | ||
item, | ||
mode, | ||
intervalsCount, | ||
compact, | ||
style, | ||
compactStyle, | ||
})} | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.