Skip to content

Commit

Permalink
Address (or bypass) lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Joseph committed Nov 29, 2024
1 parent a414efa commit e23b778
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/web/MainAppScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const MainAppScreen: React.FC<
<TabbedPanels
initialTabIdx={0}
panels={[
<TabPanel label="Graphs">
<TabPanel label="Graphs" key="Graphs_tab">
<Grid container spacing={0}>
{charts.map((chart, idx) => (
<Grid item xs={12} md={6} xl={4} key={idx}>
Expand All @@ -52,14 +52,15 @@ export const MainAppScreen: React.FC<
))}
</Grid>
</TabPanel>,
<TabPanel label="Transactions">
<TabPanel label="Transactions" key="Transactions_tab">
<TransactionsTable
accounts={props.accounts}
transactions={props.transactions}
/>
</TabPanel>,
<TabPanel
label="Uncategorised"
key="Uncategorised_tab"
warning={
uncategorised.uncategorisedTransactions.length &&
`There are ${uncategorised.uncategorisedTransactions.length} uncategorised records`
Expand All @@ -68,13 +69,13 @@ export const MainAppScreen: React.FC<
<TabbedPanels
initialTabIdx={0}
panels={[
<TabPanel label="All">
<TabPanel label="All" key="All_tab">
<TransactionsTable
accounts={props.accounts}
transactions={uncategorised.uncategorisedTransactions}
/>
</TabPanel>,
<TabPanel label="Most common">
<TabPanel label="Most common" key="Most_common_tab">
<DataGridWrapper
columns={mostCommonDescriptionsColumns}
rows={uncategorised.mostCommonDescriptions}
Expand All @@ -84,14 +85,15 @@ export const MainAppScreen: React.FC<
]}
/>
</TabPanel>,
<TabPanel label="Raw records">
<TabPanel label="Raw records" key="Raw_records_tab">
<RawRecordsTable
filesWithRawRecords={props.filesWithRawRecords}
accounts={props.accounts}
/>
</TabPanel>,
<TabPanel
label="Duplicates"
key="Duplicates_tab"
tooltip={
"(TODO)Use this tab to find overlapping/duplicate records in CSV files"
// TODO also highlight this when there _are_ duplicate records
Expand Down
1 change: 1 addition & 0 deletions src/web/filedrop/FileDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const withDropZone =
<P extends object>(
WrappedComponent: React.ComponentType<P>,
): React.FC<P & FileDropProps> =>
// eslint-disable-next-line react/display-name
({ addFile, minimal, ...props }: FileDropProps) => (
<FileDrop addFile={addFile} minimal={minimal}>
<WrappedComponent {...(props as P)} />
Expand Down
1 change: 1 addition & 0 deletions src/web/layout/Nav.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { TopBar } from "./Nav";
import LocalPizzaIcon from "@mui/icons-material/LocalPizza";
import "@testing-library/jest-dom/vitest";
import { test, expect } from "vitest";
import React from "react";

test("renders title", () => {
const { getByText } = render(
Expand Down
9 changes: 6 additions & 3 deletions src/web/layout/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ const AppBarButtons = ({
</ButtonGroup>
);

const AppSpeedDial: React.FC<{
type AppSpeedDiaProps = {
icon: React.JSXElementConstructor<any>;
iconAndOnClicks: IconAndOnClick[];
}> =
};

const AppSpeedDial: React.FC<AppSpeedDiaProps> =
// Need to use forwardRef so we can use this component in <Slide> below
React.forwardRef((props, ref) => (
// eslint-disable-next-line react/display-name
React.forwardRef((props: AppSpeedDiaProps, ref) => (
<SpeedDial
ref={ref}
ariaLabel="Quick access menu"
Expand Down
3 changes: 2 additions & 1 deletion src/web/util-comps/decorators.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Badge } from "@mui/material";
import { ComponentType } from "react";
import React, { ComponentType } from "react";

// subset of Badge#color
type Level = "error" | "info" | "success" | "warning";

export const withDotBadge =
(level: Level) =>
<P,>(WrappedComponent: ComponentType<P>) =>
// eslint-disable-next-line react/display-name
(props: P & JSX.IntrinsicAttributes) => {
return (
<Badge color={level} variant="dot">
Expand Down

0 comments on commit e23b778

Please sign in to comment.