Skip to content

Commit

Permalink
Merge pull request #42 from juliaevk/bg-switcher-value-on-hover-33
Browse files Browse the repository at this point in the history
Show background switcher value on hover
  • Loading branch information
nakulrathore authored Oct 8, 2019
2 parents 3b598aa + fc242f2 commit a719cd8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
17 changes: 16 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"color": "^3.1.2",
"react": "^15.6.2",
"react-copy-to-clipboard": "^5.0.1",
"react-dom": "^15.5.4"
"react-dom": "^15.5.4",
"react-tooltip": "^3.11.1"
},
"devDependencies": {
"react-scripts": "1.0.7"
Expand Down
3 changes: 3 additions & 0 deletions src/components/ColorList/ColorList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import Color from "color";
import COLORS from "../../colors";
import ReactTooltip from 'react-tooltip';

const ColorList = ({colors,
selectedColor,
Expand All @@ -19,12 +20,14 @@ const ColorList = ({colors,

onColorChange(colorItem.color);
}}
data-tip={ colorItem.color }
className={`color-list__button ${selectedColor === colorItem.color ? 'color-list__button--selected' : ''}`}
style={{
background: colorItem.color,
color: isDarkColorSelected ? COLORS.WHITE : COLORS.BLACK
}}
> </button>
<ReactTooltip place="top" type="dark" effect="solid"/>
</li>
)}
</ul>
Expand Down

0 comments on commit a719cd8

Please sign in to comment.