Skip to content

Commit

Permalink
[lifeparticle#395] Fix more sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
panagiotisbellias authored and Panagiotis Bellias committed Apr 18, 2024
1 parent 886aa18 commit 88c7d9e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion ui/src/components/Layouts/InputGrid/InputGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ const InputGrid: FC<InputGridProps> = ({ children, className }) => {
return (
<Row gutter={[16, 0]} className={className}>
{childElements.map((child, index) => (
<Col key={index} xs={24} sm={24} md={24} lg={12}>
<Col key={getKey(child)} xs={24} sm={24} md={24} lg={12}>
{child}
</Col>
))}
</Row>
);
};

// Function to generate unique keys based on child content
const getKey = (child: React.ReactNode): string => {
// Example: Generate a unique key based on child content
return `${child}`;
};

export default InputGrid;
8 changes: 7 additions & 1 deletion ui/src/components/Layouts/PageGrid/PageGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ const PageGrid: FC<PageGridProps> = ({ children, className }) => {
return (
<Row gutter={[16, 16]} className={className}>
{childElements.map((child, index) => (
<Col key={index} xs={24} sm={24} md={24} lg={12}>
<Col key={getKey(child)} xs={24} sm={24} md={24} lg={12}>
{child}
</Col>
))}
</Row>
);
};

// Function to generate unique keys based on child content
const getKey = (child: React.ReactNode): string => {
// Example: Generate a unique key based on child content
return `${child}`;
};

export default PageGrid;
2 changes: 1 addition & 1 deletion ui/src/pages/Colors/ShadesAndTints/components/Colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Colors: FC<ExtendedColorsProps> = ({ colors, isPending, type }) => {
<div className={styles.colors__list}>
{colors.map((color, index) => (
<Card
key={index}
key={color}
style={{
backgroundColor: color,
color: getTextColor(color),
Expand Down

0 comments on commit 88c7d9e

Please sign in to comment.