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

Added iconColor to SearchBox, fixed issue #804. #810

Merged
merged 6 commits into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to /** The search's icon 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