Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356738
D5732.id20365.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5732.id20365.diff
View Options
diff --git a/native/navigation/community-drawer-navigator.react.js b/native/navigation/community-drawer-navigator.react.js
new file mode 100644
--- /dev/null
+++ b/native/navigation/community-drawer-navigator.react.js
@@ -0,0 +1,55 @@
+// @flow
+
+import { createDrawerNavigator } from '@react-navigation/drawer';
+import * as React from 'react';
+import { Dimensions, View } from 'react-native';
+
+import { useStyles } from '../themes/colors';
+import type { AppNavigationProp } from './app-navigator.react';
+import CommunityDrawerContent from './community-drawer-content.react';
+import { TabNavigatorRouteName } from './route-names';
+import type { NavigationRoute } from './route-names';
+import TabNavigator from './tab-navigator.react';
+
+const Drawer = createDrawerNavigator();
+
+const communityDrawerContent = () => <CommunityDrawerContent />;
+
+type Props = {
+ +navigation: AppNavigationProp<'CommunityDrawerNavigator'>,
+ +route: NavigationRoute<'CommunityDrawerNavigator'>,
+};
+
+// eslint-disable-next-line no-unused-vars
+function CommunityDrawerNavigator(props: Props): React.Node {
+ const styles = useStyles(unboundStyles);
+
+ const screenOptions = React.useMemo(
+ () => ({
+ drawerStyle: styles.drawerStyle,
+ }),
+ [styles.drawerStyle],
+ );
+
+ return (
+ <View style={styles.drawerView}>
+ <Drawer.Navigator
+ screenOptions={screenOptions}
+ drawerContent={communityDrawerContent}
+ >
+ <Drawer.Screen name={TabNavigatorRouteName} component={TabNavigator} />
+ </Drawer.Navigator>
+ </View>
+ );
+}
+
+const unboundStyles = {
+ drawerView: {
+ flex: 1,
+ },
+ drawerStyle: {
+ width: Dimensions.get('window').width - 36,
+ },
+};
+
+export { CommunityDrawerNavigator };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 8:25 PM (21 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577010
Default Alt Text
D5732.id20365.diff (1 KB)
Attached To
Mode
D5732: [native] Add community drawer navigator
Attached
Detach File
Event Timeline
Log In to Comment