1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

Icons and styling

This commit is contained in:
Laurent Cozic
2017-07-21 22:40:02 +01:00
parent 7be22369ac
commit 29b607fac6
20 changed files with 150 additions and 51 deletions

@ -2,13 +2,13 @@ import React, { Component } from 'react';
import { StyleSheet, TouchableHighlight } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
const styles = StyleSheet.create({
const styles = {
checkboxIcon: {
fontSize: 20,
height: 22,
marginRight: 10,
},
});
};
class Checkbox extends Component {
@ -42,9 +42,19 @@ class Checkbox extends Component {
style.justifyContent = 'center';
style.alignItems = 'center';
const checkboxIconStyle = Object.assign({}, styles.checkboxIcon);
if (style.color) checkboxIconStyle.color = style.color;
const thStyle = {
justifyContent: 'center',
alignItems: 'center',
};
if (style.display) thStyle.display = style.display;
return (
<TouchableHighlight onPress={() => this.onPress()} style={style}>
<Icon name={iconName} style={styles.checkboxIcon}/>
<TouchableHighlight onPress={() => this.onPress()} style={thStyle}>
<Icon name={iconName} style={checkboxIconStyle}/>
</TouchableHighlight>
);
}