🐛 Fix keys attribute on ColorSelector

This commit is contained in:
ajnart
2022-08-01 21:11:37 +02:00
parent 8bc74f4e0f
commit c501cfae76
2 changed files with 3 additions and 6 deletions

View File

@@ -44,12 +44,11 @@ export function ColorSelector({ type }: ColorControlProps) {
}; };
const swatches = colors.map(({ color, swatch }) => ( const swatches = colors.map(({ color, swatch }) => (
<Grid.Col span={2}> <Grid.Col span={2} key={color}>
<ColorSwatch <ColorSwatch
component="button" component="button"
type="button" type="button"
onClick={() => setConfigColor(color)} onClick={() => setConfigColor(color)}
key={color}
color={swatch} color={swatch}
size={22} size={22}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}

View File

@@ -40,12 +40,11 @@ export function ShadeSelector() {
}; };
const primarySwatches = primaryShades.map(({ swatch, shade }) => ( const primarySwatches = primaryShades.map(({ swatch, shade }) => (
<Grid.Col span={1}> <Grid.Col span={1} key={Number(shade)}>
<ColorSwatch <ColorSwatch
component="button" component="button"
type="button" type="button"
onClick={() => setConfigShade(shade)} onClick={() => setConfigShade(shade)}
key={Number(shade)}
color={swatch} color={swatch}
size={22} size={22}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
@@ -54,12 +53,11 @@ export function ShadeSelector() {
)); ));
const secondarySwatches = secondaryShades.map(({ swatch, shade }) => ( const secondarySwatches = secondaryShades.map(({ swatch, shade }) => (
<Grid.Col span={1}> <Grid.Col span={1} key={Number(shade)}>
<ColorSwatch <ColorSwatch
component="button" component="button"
type="button" type="button"
onClick={() => setConfigShade(shade)} onClick={() => setConfigShade(shade)}
key={Number(shade)}
color={swatch} color={swatch}
size={22} size={22}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}