react-navigation / react-navigation
Showing 1 of 2 files from the diff.

@@ -45,8 +45,24 @@
Loading
45 45
      drawerIcon,
46 46
      drawerLabelStyle,
47 47
      drawerItemStyle,
48 +
      onPress,
48 49
    } = descriptors[route.key].options;
49 50
51 +
    const defaultOnPress = () => {
52 +
      navigation.dispatch({
53 +
        ...(focused
54 +
          ? DrawerActions.closeDrawer()
55 +
          : CommonActions.navigate({ name: route.name, merge: true })),
56 +
        target: state.key,
57 +
      });
58 +
    };
59 +
60 +
    let handlePress = defaultOnPress;
61 +
62 +
    if (onPress) {
63 +
      handlePress = () => onPress(defaultOnPress);
64 +
    }
65 +
50 66
    return (
51 67
      <DrawerItem
52 68
        key={route.key}
@@ -66,14 +82,7 @@
Loading
66 82
        labelStyle={drawerLabelStyle}
67 83
        style={drawerItemStyle}
68 84
        to={buildLink(route.name, route.params)}
69 -
        onPress={() => {
70 -
          navigation.dispatch({
71 -
            ...(focused
72 -
              ? DrawerActions.closeDrawer()
73 -
              : CommonActions.navigate({ name: route.name, merge: true })),
74 -
            target: state.key,
75 -
          });
76 -
        }}
85 +
        onPress={handlePress}
77 86
      />
78 87
    );
79 88
  }) as React.ReactNode as React.ReactElement;
Files Coverage
packages 74.45%
Project Totals (160 files) 74.45%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading