I am trying to use flexbox to align my icon to the left of a button view and the text to the center. Currently they are both aligned to the center but I am not sure how to get my icon on the very left edge of the button while keeping the text centered in the view
Right now my button looks like this:
I am using https://github.com/APSL/react-native-button for buttons and https://github.com/oblador/react-native-vector-icons for icons
Below is some of my code:
<Button style={signupStyles.facebookButton}>
<View style={signupStyles.nestedButtonView}>
<Icon
name="facebook"
size={30}
color={'white'}
/>
<Text style={signupStyles.buttonText}>Continue with Facebook</Text>
</View>
</Button>
var signupStyles = StyleSheet.create({
buttonText: {
color: 'white',
fontWeight: 'bold',
textAlign: 'center',
},
facebookButton: {
backgroundColor: styleConstants.facebookColor,
borderColor: styleConstants.facebookColor,
borderWidth: 2,
borderRadius: 22,
},
nestedButtonView: {
flexDirection: 'row',
alignItems: 'center',
},
});