@@ -4,7 +4,8 @@ import styled from 'styled-components';
44
55import Tooltip from 'app/components/Tooltip' ;
66
7- const styles = props => `
7+ const styles = props =>
8+ `
89 transition: 0.3s ease all;
910 display: flex;
1011 flex-direction: row;
@@ -19,11 +20,23 @@ const styles = props => `
1920 box-sizing: inherit;
2021 border-bottom: 2px solid transparent;
2122 z-index: 1;
23+ ${ props . highlight ? `
24+ background-color: ${ props . theme . secondary . darken ( 0.1 ) ( ) } ;
25+ color: white;
26+ border-bottom: 0px solid transparent;
27+
28+ &:hover {
29+ background-color: ${ props . theme . secondary . darken ( 0.2 ) ( ) } ;
30+ }
31+ ` : `
32+
33+ &:hover {
34+ color: rgba(255,255,255, 1);
35+ border-color: ${ props . theme . secondary ( ) }
36+ }
37+ ` }
38+
2239
23- &:hover {
24- color: rgba(255,255,255, 1);
25- border-bottom: 2px solid ${ props . theme . secondary ( ) } ;
26- }
2740` ;
2841
2942const Action = styled . div `
@@ -56,9 +69,17 @@ type Props = {
5669 title : string ,
5770 href : ?string ,
5871 placeholder : ?boolean ,
72+ highlight : ?boolean ,
5973} ;
6074
61- export default ( { onClick, href, Icon, title, placeholder } : Props ) => {
75+ export default ( {
76+ onClick,
77+ href,
78+ Icon,
79+ title,
80+ highlight,
81+ placeholder,
82+ } : Props ) => {
6283 if ( placeholder ) {
6384 return (
6485 < ActionTooltip message = { placeholder } >
@@ -70,7 +91,7 @@ export default ({ onClick, href, Icon, title, placeholder }: Props) => {
7091 }
7192 if ( onClick ) {
7293 return (
73- < Action onClick = { onClick } >
94+ < Action highlight = { highlight } onClick = { onClick } >
7495 < IconContainer >
7596 < Icon />
7697 </ IconContainer > { title }
@@ -79,7 +100,7 @@ export default ({ onClick, href, Icon, title, placeholder }: Props) => {
79100 }
80101
81102 return (
82- < ActionLink to = { href } >
103+ < ActionLink highlight = { highlight } to = { href } >
83104 < IconContainer >
84105 < Icon />
85106 </ IconContainer > { title }
0 commit comments