Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(logs-react): fix eslint errors in cardList and LogChips #9

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(logs-react): fix eslint errors in cardList and LogChips
- Add key props to CardListItem components in cardList\n- Remove unnecessary boolean type annotation in LogChips
  • Loading branch information
BelfordZ committed Nov 29, 2024
commit d8b70aa28c673598dd05633e2f16137299db772c
4 changes: 2 additions & 2 deletions packages/logs-react/src/components/cardList/cardList.tsx
Original file line number Diff line number Diff line change
@@ -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} />;
}
})}
</>
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";
@@ -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],
Loading