|
|
|
@ -11,6 +11,11 @@ import { BASE_INDICATOR } from './styles'; |
|
|
|
|
|
|
|
|
|
type Props = { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Overwritten background color when indicator is highlighted. |
|
|
|
|
*/ |
|
|
|
|
backgroundColor?: string; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* True if a highlighted background has to be applied. |
|
|
|
|
*/ |
|
|
|
@ -38,12 +43,17 @@ export default class BaseIndicator extends Component<Props> { |
|
|
|
|
* @inheritdoc |
|
|
|
|
*/ |
|
|
|
|
render() { |
|
|
|
|
const { highlight, icon, iconStyle } = this.props; |
|
|
|
|
const { highlight, icon, iconStyle, backgroundColor } = this.props; |
|
|
|
|
const highlightedIndicator = { ...styles.highlightedIndicator }; |
|
|
|
|
|
|
|
|
|
if (backgroundColor) { |
|
|
|
|
highlightedIndicator.backgroundColor = backgroundColor; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<View |
|
|
|
|
style = { [ BASE_INDICATOR, |
|
|
|
|
highlight ? styles.highlightedIndicator : null ] }> |
|
|
|
|
highlight ? highlightedIndicator : null ] }> |
|
|
|
|
<Icon |
|
|
|
|
src = { icon } |
|
|
|
|
style = { [ |
|
|
|
|