feat: Move itemStyle to SafeAreaView (#55)

In order to add a custom style like borderRadius to the drawer item, it's necessary to pass a prop to SafeAreaView. Thus, the inner view
was removed and itemStyle has been moved to SafeAreaView
This commit is contained in:
Bruno Castro
2019-03-08 16:06:06 -03:00
committed by satyajit.happy
parent e38524c03f
commit a59ed91aad

View File

@@ -47,35 +47,33 @@ const DrawerNavigatorItems = ({
delayPressIn={0} delayPressIn={0}
> >
<SafeAreaView <SafeAreaView
style={{ backgroundColor }} style={[{ backgroundColor }, styles.item, itemStyle]}
forceInset={{ forceInset={{
[drawerPosition]: 'always', [drawerPosition]: 'always',
[drawerPosition === 'left' ? 'right' : 'left']: 'never', [drawerPosition === 'left' ? 'right' : 'left']: 'never',
vertical: 'never', vertical: 'never',
}} }}
> >
<View style={[styles.item, itemStyle]}> {icon ? (
{icon ? ( <View
<View style={[
style={[ styles.icon,
styles.icon, focused ? null : styles.inactiveIcon,
focused ? null : styles.inactiveIcon, iconContainerStyle,
iconContainerStyle, ]}
]} >
> {icon}
{icon} </View>
</View> ) : null}
) : null} {typeof label === 'string' ? (
{typeof label === 'string' ? ( <Text
<Text style={[styles.label, { color }, labelStyle, extraLabelStyle]}
style={[styles.label, { color }, labelStyle, extraLabelStyle]} >
> {label}
{label} </Text>
</Text> ) : (
) : ( label
label )}
)}
</View>
</SafeAreaView> </SafeAreaView>
</TouchableItem> </TouchableItem>
); );