@@ -6,23 +6,23 @@ import { connect } from 'react-redux';
66import { toggle } from '../actions' ;
77import SVG from './Svg' ;
88
9- const StyledToggleButton = styled . button `
10- background-color: #2e2e2e ;
11- border: 1px solid #555555 ;
9+ const StyledToggle = styled . button `
10+ background-color: ${ props => props . theme . background } ;
11+ border: 1px solid ${ props => props . theme . buttonBackground } ;
1212 border-radius: 50%;
13- color: #999999 ;
13+ color: ${ props => props . theme . buttonBackgroundHover } ;
1414 cursor: pointer;
1515 height: 2.5rem;
1616 margin: 0 0 0 1rem;
1717 outline: 0;
1818 width: 2.5rem;
1919
2020 &:hover {
21- background-color: #484848 ;
21+ background-color: ${ props => props . theme . buttonBackground } ;
2222
2323 & svg,
2424 & g {
25- fill: #ffffff ;
25+ fill: ${ props => props . theme . buttonColorHover } ;
2626 }
2727 }
2828
@@ -32,29 +32,29 @@ const StyledToggleButton = styled.button`
3232
3333 & svg,
3434 & g {
35- fill: #ffffff ;
35+ fill: ${ props => props . theme . buttonColorHover } ;
3636 }
3737 }
3838
3939 &.light {
40- background-color: #ffffff ;
41- border-color: #d8d8d8 ;
40+ background-color: ${ props => props . theme . buttonColorHover } ;
41+ border-color: ${ props => props . theme . buttonBorderHover } ;
4242
4343 & svg,
4444 & g {
45- fill: #a8a8a8 ;
45+ fill: ${ props => props . theme . buttonBorder } ;
4646 }
4747
4848 &:hover {
4949 & svg,
5050 & g {
51- fill: #707070 ;
51+ fill: ${ props => props . theme . buttonBorder } ;
5252 }
5353 }
5454 }
5555` ;
5656
57- const ToggleButton = props => {
57+ const Toggle = props => {
5858 const { toggle, control, js, mode } = props ;
5959
6060 let isActive , isLightMode ;
@@ -64,16 +64,13 @@ const ToggleButton = props => {
6464 if ( ! isActive && mode === 'light' ) isLightMode = 'light' ;
6565
6666 return (
67- < StyledToggleButton
68- onClick = { ( ) => toggle ( control ) }
69- className = { classnames ( isActive , isLightMode ) }
70- >
67+ < StyledToggle onClick = { ( ) => toggle ( control ) } className = { classnames ( isActive , isLightMode ) } >
7168 < SVG control = { control } />
72- </ StyledToggleButton >
69+ </ StyledToggle >
7370 ) ;
7471} ;
7572
76- ToggleButton . propTypes = {
73+ Toggle . propTypes = {
7774 toggle : PropTypes . func . isRequired ,
7875 control : PropTypes . string . isRequired ,
7976 mode : PropTypes . string . isRequired ,
@@ -90,4 +87,4 @@ const mapDispatchToProps = dispatch => {
9087export default connect (
9188 mapStateToProps ,
9289 mapDispatchToProps
93- ) ( ToggleButton ) ;
90+ ) ( Toggle ) ;
0 commit comments