|
@@ -11,6 +11,11 @@ import { BASE_INDICATOR } from './styles';
|
11
|
11
|
|
12
|
12
|
type Props = {
|
13
|
13
|
|
|
14
|
+ /**
|
|
15
|
+ * Overwritten background color when indicator is highlighted.
|
|
16
|
+ */
|
|
17
|
+ backgroundColor?: string;
|
|
18
|
+
|
14
|
19
|
/**
|
15
|
20
|
* True if a highlighted background has to be applied.
|
16
|
21
|
*/
|
|
@@ -38,12 +43,17 @@ export default class BaseIndicator extends Component<Props> {
|
38
|
43
|
* @inheritdoc
|
39
|
44
|
*/
|
40
|
45
|
render() {
|
41
|
|
- const { highlight, icon, iconStyle } = this.props;
|
|
46
|
+ const { highlight, icon, iconStyle, backgroundColor } = this.props;
|
|
47
|
+ const highlightedIndicator = { ...styles.highlightedIndicator };
|
|
48
|
+
|
|
49
|
+ if (backgroundColor) {
|
|
50
|
+ highlightedIndicator.backgroundColor = backgroundColor;
|
|
51
|
+ }
|
42
|
52
|
|
43
|
53
|
return (
|
44
|
54
|
<View
|
45
|
55
|
style = { [ BASE_INDICATOR,
|
46
|
|
- highlight ? styles.highlightedIndicator : null ] }>
|
|
56
|
+ highlight ? highlightedIndicator : null ] }>
|
47
|
57
|
<Icon
|
48
|
58
|
src = { icon }
|
49
|
59
|
style = { [
|