feat: add a Background component

This commit is contained in:
Satyajit Sahoo
2021-03-22 19:03:09 +01:00
parent dd48fe9b15
commit cbaabc1288
8 changed files with 67 additions and 61 deletions

View File

@@ -93,7 +93,6 @@ type Props = {
statusBarAnimation: 'slide' | 'none' | 'fade';
overlayStyle?: StyleProp<ViewStyle>;
drawerStyle?: StyleProp<ViewStyle>;
sceneContainerStyle?: StyleProp<ViewStyle>;
renderDrawerContent: Renderer;
renderSceneContent: Renderer;
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
@@ -573,7 +572,6 @@ export default class DrawerView extends React.Component<Props> {
drawerPosition,
drawerType,
swipeEdgeWidth,
sceneContainerStyle,
drawerStyle,
overlayStyle,
renderDrawerContent,
@@ -642,7 +640,6 @@ export default class DrawerView extends React.Component<Props> {
style={[
styles.content,
{ transform: [{ translateX: contentTranslateX }] },
sceneContainerStyle as any,
]}
>
<View

View File

@@ -89,7 +89,6 @@ function DrawerViewBase({
gestureHandlerProps,
keyboardDismissMode = 'on-drag',
overlayColor = 'rgba(0, 0, 0, 0.5)',
sceneContainerStyle,
swipeEdgeWidth,
swipeEnabled,
swipeMinDistance,
@@ -181,6 +180,7 @@ function DrawerViewBase({
}
/>
),
sceneContainerStyle,
} = descriptor.options;
return (
@@ -191,6 +191,7 @@ function DrawerViewBase({
enabled={detachInactiveScreens}
>
<Screen
focused={isFocused}
route={descriptor.route}
navigation={descriptor.navigation}
headerShown={descriptor.options.headerShown}
@@ -201,6 +202,7 @@ function DrawerViewBase({
navigation: descriptor.navigation as DrawerNavigationProp<ParamListBase>,
options: descriptor.options,
})}
style={sceneContainerStyle}
>
{descriptor.render()}
</Screen>
@@ -222,10 +224,6 @@ function DrawerViewBase({
gestureHandlerProps={gestureHandlerProps}
drawerType={drawerType}
drawerPosition={drawerPosition}
sceneContainerStyle={[
{ backgroundColor: colors.background },
sceneContainerStyle,
]}
drawerStyle={[
{
width: getDefaultDrawerWidth(dimensions),