Skip to content

Commit

Permalink
fix(logs-react): fix eslint errors in cardList and LogChips
Browse files Browse the repository at this point in the history
- Add key props to CardListItem components in cardList\n- Remove unnecessary boolean type annotation in LogChips
  • Loading branch information
BelfordZ committed Nov 29, 2024
1 parent fcce050 commit d8b70aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/logs-react/src/components/cardList/cardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const CardList: React.FC<IProps> = (props) => {
<>
{props.logs.map((call, i) => {
if (props.logs.length - 1 === i) {
return <CardListItem openrpcDocument={props.openrpcDocument} log={call} filter={props.filter} open={true} />;
return <CardListItem key={`log-${i}`} openrpcDocument={props.openrpcDocument} log={call} filter={props.filter} open={true} />;
} else {
return <CardListItem openrpcDocument={props.openrpcDocument} log={call} filter={props.filter} open={false} />;
return <CardListItem key={`log-${i}`} openrpcDocument={props.openrpcDocument} log={call} filter={props.filter} open={false} />;
}
})}
</>
Expand Down
3 changes: 1 addition & 2 deletions packages/logs-react/src/components/logChips/LogChips.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import React from "react";
import { IJSONRPCLog } from "../logsReact/logsReact";
import {Chip} from "@material-ui/core";
Expand All @@ -8,7 +7,7 @@ interface IProps {
log: IJSONRPCLog;
}

const getChipColorForLog = (log: IJSONRPCLog, theme: Theme, isNotification: boolean = false): any => {
const getChipColorForLog = (log: IJSONRPCLog, theme: Theme, isNotification = false): any => {
const paletteType = theme.palette.type;
const styles: any = {
backgroundColor: theme.palette.success[paletteType],
Expand Down

0 comments on commit d8b70aa

Please sign in to comment.