diff --git a/lib/Avatar.js b/lib/Avatar.js index 1126c16..7cd281b 100644 --- a/lib/Avatar.js +++ b/lib/Avatar.js @@ -1,5 +1,5 @@ import React, {Component, PropTypes} from "react"; -import {View, Image, Text} from "react-native"; +import {StyleSheet, View, Image, Text} from "react-native"; import Icon from './Icon'; import { getColor } from './helpers'; @@ -9,6 +9,8 @@ export default class Avatar extends Component { image: PropTypes.shape({ type: PropTypes.oneOf([Image]) }), icon: PropTypes.string, size: PropTypes.number, + textSize: PropTypes.number, + textLineHeight: PropTypes.number, color: PropTypes.string, backgroundColor: PropTypes.string, text: PropTypes.string, @@ -33,6 +35,8 @@ export default class Avatar extends Component { size, color, backgroundColor, + textSize, + textLineHeight, text, borderRadius, borderColor, @@ -69,7 +73,17 @@ export default class Avatar extends Component { return ( - {text} + + {text} + ); @@ -78,3 +92,11 @@ export default class Avatar extends Component { return null; } } + +const styles = StyleSheet.create({ + text: { + textAlign: 'center', + textAlignVertical: 'center', + includeFontPadding: false + } +}); \ No newline at end of file