summaryrefslogtreecommitdiffhomepage
path: root/app/components/Img.android.js
diff options
context:
space:
mode:
authoranderklander <anderklander@gmail.com>2018-02-15 14:05:28 +0100
committeranderklander <anderklander@gmail.com>2018-02-15 16:02:03 +0100
commit89eeb129f065d92a82393db2deca58c0c0f2ff38 (patch)
tree9d61e6b951139dfb061c1898b7eb0aab4c5e3e73 /app/components/Img.android.js
parent7ed21c2ae70a875029715d4d4c10a1c59508d6fa (diff)
downloadmullvadvpn-89eeb129f065d92a82393db2deca58c0c0f2ff38.tar.xz
mullvadvpn-89eeb129f065d92a82393db2deca58c0c0f2ff38.zip
Refactoring stuff, removed Icon
Diffstat (limited to 'app/components/Img.android.js')
-rw-r--r--app/components/Img.android.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/components/Img.android.js b/app/components/Img.android.js
index 436f805ccb..ced9d3f461 100644
--- a/app/components/Img.android.js
+++ b/app/components/Img.android.js
@@ -7,20 +7,25 @@ export default class Img extends Component {
props: {
source: string,
style: Object,
- tintColor?: string
+ tintColor?: string,
+ height?: number,
+ width?:number,
};
render(){
- const { source, tintColor, style } = this.props;
+ const width = this.props.width || 7;
+ const height = this.props.height || 12;
+ const source = this.props.source || 'icon-chevron';
+ const tintColor = this.props.tintColor || 'currentColor';
- if (tintColor === 'currentColor' && style) {
- const { color: tint, ...otherStyles } = StyleSheet.flatten(style);
+ if (tintColor === 'currentColor' && this.props.style) {
+ const { color: tint, ...otherStyles } = StyleSheet.flatten(this.props.style);
return(
- <Image style={[ otherStyles, { tintColor: tint } ]} source={ source }/>
+ <Image style={[ otherStyles, { tintColor: tint, height: height, width: width } ]} source={ source }/>
);
} else {
return(
- <Image style={ style } source={ source }/>
+ <Image style={[ this.props.style, { height: height, width: width } ]} source={ source }/>
);
}
}