From ad9e029cb1573b19baf43141e9278adf5d0f3db8 Mon Sep 17 00:00:00 2001 From: mguida22 Date: Wed, 12 Apr 2017 13:12:49 -0600 Subject: [PATCH] default iconSize and titleSize to half of width --- src/avatar/Avatar.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/avatar/Avatar.js b/src/avatar/Avatar.js index 751154eade..87e6f9f31f 100644 --- a/src/avatar/Avatar.js +++ b/src/avatar/Avatar.js @@ -36,40 +36,30 @@ const Avatar = (props) => { height, } = props; - let titleSize = 17; - let iconSize = 17; - if(small) { width = 34; height = 34; - titleSize = 17; - iconSize = 17; } else if (medium) { width = 50; height = 50; - titleSize = 25; - iconSize = 25; } else if (large) { width = 75; height = 75; - titleSize = 37.5; - iconSize = 37.5; } else if (xlarge) { width = 150; height = 150; - titleSize = 75; - iconSize = 75; } else if(!width && !height) { width = 34; height = 34; } else if (!width) { width = height; - titleSize = width/2; } else if (!height) { height = width; - titleSize = height/2; } + let titleSize = width/2; + let iconSize = width/2; + let Component = onPress || onLongPress ? TouchableOpacity : View; if (component) { Component = component;