Skip to content

Commit

Permalink
Added iconColor to SearchBox, fixed issue #804.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjaak Luthart committed Jul 21, 2017
1 parent 9209910 commit 1b270cb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
29 changes: 29 additions & 0 deletions docs/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,13 @@
"value": "{}",
"computed": false
}
},
"iconColor": {
"type": {
"name": "string"
},
"required": true,
"description": ""
}
}
},
Expand Down Expand Up @@ -1593,6 +1600,17 @@
"required": true,
"description": "Function to hide the menu"
},
"iconColor": {
"type": {
"name": "string"
},
"required": false,
"description": "Category icon color",
"defaultValue": {
"value": "colors.icons",
"computed": true
}
},
"color": {
"type": {
"name": "string"
Expand Down Expand Up @@ -5399,6 +5417,17 @@
"value": "{}",
"computed": false
}
},
"iconColor": {
"type": {
"name": "string"
},
"required": false,
"description": "The search icon's color",
"defaultValue": {
"value": "colors.icons",
"computed": true
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/channel-header/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import colors from '../settings/colors';

const styleSheet = {
root: {
background: colors.white,
backgroundColor: colors.white,
borderBottom: `1px solid ${colors.grey}`,
position: 'relative',
padding: '8px 56px',
Expand Down
11 changes: 8 additions & 3 deletions src/search-box/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import pure from 'recompose/pure';
import debounce from 'lodash/debounce';
import IconSearch from '../icons/icon-search';
import getStyles from './get-styles';
import colors from '../settings/colors';

const displayName = 'SearchBox';

Expand Down Expand Up @@ -32,15 +33,18 @@ const propTypes = {
/** Override the styles of the icon element */
iconStyle: PropTypes.instanceOf(Object),
/** Override the styles of the input's placeholder */
placeholderStyle: PropTypes.instanceOf(Object)
placeholderStyle: PropTypes.instanceOf(Object),
/** The search icon's color */
iconColor: PropTypes.string
};

const defaultProps = {
style: {},
inputStyle: {},
iconStyle: {},
placeholder: 'Search something...',
placeholderStyle: {}
placeholderStyle: {},
iconColor: colors.icons
};

/** General purpose Search box */
Expand Down Expand Up @@ -75,12 +79,13 @@ class SearchBox extends Component {
changeSearchQuery,
onChange,
placeholderStyle,
iconColor,
...custom
} = this.props;

return (
<section style={getStyles.root(style)} {...custom}>
<div style={getStyles.icon(iconStyle)}><IconSearch /></div>
<div style={getStyles.icon(iconStyle)}><IconSearch color={iconColor} /></div>
<input
style={getStyles.input(inputStyle)}
value={value}
Expand Down

0 comments on commit 1b270cb

Please sign in to comment.