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}
>
<SafeAreaView
style={{ backgroundColor }}
style={[{ backgroundColor }, styles.item, itemStyle]}
forceInset={{
[drawerPosition]: 'always',
[drawerPosition === 'left' ? 'right' : 'left']: 'never',
vertical: 'never',
}}
>
<View style={[styles.item, itemStyle]}>
{icon ? (
<View
style={[
styles.icon,
focused ? null : styles.inactiveIcon,
iconContainerStyle,
]}
>
{icon}
</View>
) : null}
{typeof label === 'string' ? (
<Text
style={[styles.label, { color }, labelStyle, extraLabelStyle]}
>
{label}
</Text>
) : (
label
)}
</View>
{icon ? (
<View
style={[
styles.icon,
focused ? null : styles.inactiveIcon,
iconContainerStyle,
]}
>
{icon}
</View>
) : null}
{typeof label === 'string' ? (
<Text
style={[styles.label, { color }, labelStyle, extraLabelStyle]}
>
{label}
</Text>
) : (
label
)}
</SafeAreaView>
</TouchableItem>
);