diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-26 17:29:53 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-26 17:29:53 -0700 |
commit | 2ddcfc41e2ee4a25e8ea95a470b0d7ea8847f1cf (patch) | |
tree | c89e8e84ad90c9e20c06e460d292205b8ab94f2e /modern/src | |
parent | ec66ad6b53330c19399532268b8a65cc3e3ba240 (diff) | |
download | trackermap-web-2ddcfc41e2ee4a25e8ea95a470b0d7ea8847f1cf.tar.gz trackermap-web-2ddcfc41e2ee4a25e8ea95a470b0d7ea8847f1cf.tar.bz2 trackermap-web-2ddcfc41e2ee4a25e8ea95a470b0d7ea8847f1cf.zip |
Better shimmer lint fix
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/common/components/TableShimmer.js | 5 | ||||
-rw-r--r-- | modern/src/settings/components/EditItemView.js | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/modern/src/common/components/TableShimmer.js b/modern/src/common/components/TableShimmer.js index 3bccb22c..08a984a4 100644 --- a/modern/src/common/components/TableShimmer.js +++ b/modern/src/common/components/TableShimmer.js @@ -1,13 +1,12 @@ import React from 'react'; import { Skeleton, TableCell, TableRow } from '@mui/material'; -/* eslint-disable react/no-array-index-key */ const TableShimmer = ({ columns, startAction, endAction }) => [...Array(3)].map((_, i) => ( - <TableRow key={i}> + <TableRow key={-i}> {[...Array(columns)].map((_, j) => { const action = (startAction && j === 0) || (endAction && j === columns - 1); return ( - <TableCell key={j} padding={action ? 'none' : 'normal'}> + <TableCell key={-j} padding={action ? 'none' : 'normal'}> {!action && <Skeleton />} </TableCell> ); diff --git a/modern/src/settings/components/EditItemView.js b/modern/src/settings/components/EditItemView.js index a646f629..d45855dd 100644 --- a/modern/src/settings/components/EditItemView.js +++ b/modern/src/settings/components/EditItemView.js @@ -84,8 +84,8 @@ const EditItemView = ({ </Typography> </AccordionSummary> <AccordionDetails> - {[...Array(3)].map(() => ( - <Skeleton width="100%"> + {[...Array(3)].map((_, i) => ( + <Skeleton key={-i} width="100%"> <TextField /> </Skeleton> ))} |