Skip to content

Commit

Permalink
chore: more react key warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tethik committed Jul 2, 2024
1 parent 73cbbd3 commit 0cebffd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/src/components/elements/list/ModelList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ListItemButton,
ListItemText,
} from "@mui/material";
import React from "react";
import React, { Fragment } from "react";
import { Link } from "react-router-dom";
import Loading from "../../loading";
import { SystemName } from "../../reviews/SystemName";
Expand All @@ -32,7 +32,7 @@ export function ModelList({
)}
{Array.isArray(models) &&
models.map((model, i) => (
<>
<Fragment key={`mdl-${model.id}`}>
<ListItemButton
component={Link}
to={`/model/${model.id}`}
Expand Down Expand Up @@ -62,7 +62,7 @@ export function ModelList({
/>
</ListItemButton>
{i < models.length - 1 && <Divider component="li" />}
</>
</Fragment>
))}
</List>
</CardContent>
Expand Down
7 changes: 6 additions & 1 deletion app/src/components/systems/TeamSystems/TeamSystemPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ export function TeamSystemsPage() {
>
{/* Some employees have more than one team */}
{teams.map((tid) => (
<Grid item xs={6} sx={{ display: "flex", flexDirection: "column" }}>
<Grid
key={`team-grid-${tid}`}
item
xs={6}
sx={{ display: "flex", flexDirection: "column" }}
>
<TeamSystemsPageList key={tid} teamId={tid} />
</Grid>
))}
Expand Down
8 changes: 4 additions & 4 deletions app/src/components/systems/TeamSystems/TeamSystemsPageList.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Pagination,
Typography,
} from "@mui/material";
import { useState } from "react";
import { Fragment, useState } from "react";
import { Link } from "react-router-dom";
import { useListSystemsQuery } from "../../../api/gram/system";
import { SystemComplianceBadge } from "../../elements/SystemComplianceBadge";
Expand Down Expand Up @@ -59,17 +59,17 @@ export function TeamSystemsPageList({ teamId, pagesize = 10 }) {
<Loading />
) : systems ? (
systems.map((system, i) => (
<>
<Fragment key={`sys-${system.id}`}>
<ListItemButton
component={Link}
to={`/system/${system.id}`}
key={system.id}
key={`sys-btn-${system.id}`}
>
<ListItemText primary={system.displayName} />
<SystemComplianceBadge compliance={system.compliance} />
</ListItemButton>
{i < systems.length - 1 && <Divider component="li" />}
</>
</Fragment>
))
) : (
<ListItemText primary="No team systems available." />
Expand Down

0 comments on commit 0cebffd

Please sign in to comment.