Browse Source

icon image tint color

Artal Druk 8 years ago
parent
commit
553615ae29
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/RichTextToolbar.js

+ 4
- 2
src/RichTextToolbar.js View File

@@ -31,9 +31,11 @@ export default class RichTextToolbar extends Component {
31 31
     onPressAddLink: PropTypes.func,
32 32
     onPressAddImage: PropTypes.func,
33 33
     selectedButtonStyle: PropTypes.object,
34
+    iconTint: PropTypes.any,
35
+    selectedIconTint: PropTypes.any,
34 36
     unselectedButtonStyle: PropTypes.object,
35 37
     renderAction: PropTypes.func,
36
-    iconMap: PropTypes.object
38
+    iconMap: PropTypes.object,
37 39
   };
38 40
 
39 41
   constructor(props) {
@@ -107,7 +109,7 @@ export default class RichTextToolbar extends Component {
107 109
           ]}
108 110
           onPress={() => this._onPress(action)}
109 111
       >
110
-        {icon ? <Image source={icon}/> : null}
112
+        {icon ? <Image source={icon} style={{tintColor: selected ? this.props.selectedIconTint : this.props.iconTint}}/> : null}
111 113
       </TouchableOpacity>
112 114
     );
113 115
   }