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

Allow color swatch to render correct on duplicate colors #853

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/components/block/BlockSwatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const BlockSwatches = ({ colors, onClick, onSwatchHover }) => {

return (
<div style={ styles.swatches }>
{ map(colors, c => (
{ map(colors, (c, i) => (
<Swatch
key={ c }
key={ i }
color={ c }
style={ styles.swatch }
onClick={ onClick }
Expand Down
4 changes: 2 additions & 2 deletions src/components/circle/Circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const Circle = ({ width, onChange, onSwatchHover, colors, hex, circleSize

return (
<div style={ styles.card } className={ `circle-picker ${ className }` }>
{ map(colors, c => (
{ map(colors, (c, i) => (
<CircleSwatch
key={ c }
key={ i }
color={ c }
onClick={ handleChange }
onSwatchHover={ onSwatchHover }
Expand Down
4 changes: 2 additions & 2 deletions src/components/compact/Compact.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export const Compact = ({ onChange, onSwatchHover, colors, hex, rgb,
<Raised style={ styles.Compact } styles={ passedStyles }>
<div style={ styles.compact } className={ `compact-picker ${ className }` }>
<div>
{ map(colors, (c) => (
{ map(colors, (c, i) => (
<CompactColor
key={ c }
key={ i }
color={ c }
active={ c.toLowerCase() === hex }
onClick={ handleChange }
Expand Down
4 changes: 2 additions & 2 deletions src/components/github/Github.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export const Github = ({ width, colors, onChange, onSwatchHover, triangle,
<div style={ styles.card } className={ `github-picker ${ className }` }>
<div style={ styles.triangleShadow } />
<div style={ styles.triangle } />
{ map(colors, c => (
{ map(colors, (c, i) => (
<GithubSwatch
color={ c }
key={ c }
key={ i }
onClick={ handleChange }
onSwatchHover={ onSwatchHover }
/>
Expand Down