mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-04-20 06:53:56 -04:00
61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
// @flow
|
|
|
|
import {
|
|
DrawerContentScrollView,
|
|
DrawerItem
|
|
} from "@react-navigation/drawer";
|
|
import type { Node } from "react";
|
|
import React from "react";
|
|
import useCurrentUser from "sharedHooks/useCurrentUser";
|
|
|
|
type Props = {
|
|
state: any,
|
|
navigation: any,
|
|
descriptors: any
|
|
}
|
|
|
|
const CustomDrawerContent = ( { ...props }: Props ): Node => {
|
|
// $FlowFixMe
|
|
const { state, navigation, descriptors } = props;
|
|
const currentUser = useCurrentUser( );
|
|
|
|
return (
|
|
<DrawerContentScrollView state={state} navigation={navigation} descriptors={descriptors}>
|
|
<DrawerItem
|
|
label="search"
|
|
onPress={( ) => navigation.navigate( "search" )}
|
|
/>
|
|
<DrawerItem
|
|
label="identify"
|
|
onPress={( ) => navigation.navigate( "Identify" )}
|
|
/>
|
|
<DrawerItem
|
|
label="projects"
|
|
onPress={( ) => navigation.navigate( "Projects" )}
|
|
/>
|
|
<DrawerItem
|
|
label="about"
|
|
onPress={( ) => navigation.navigate( "about" )}
|
|
/>
|
|
<DrawerItem
|
|
label="settings"
|
|
onPress={( ) => navigation.navigate( "settings" )}
|
|
/>
|
|
<DrawerItem
|
|
label="network/logging"
|
|
onPress={( ) => navigation.navigate( "network" )}
|
|
/>
|
|
<DrawerItem
|
|
label="UI library"
|
|
onPress={( ) => navigation.navigate( "UI Library" )}
|
|
/>
|
|
<DrawerItem
|
|
label={currentUser ? "logout" : "login"}
|
|
onPress={( ) => navigation.navigate( "Login" )}
|
|
/>
|
|
</DrawerContentScrollView>
|
|
);
|
|
};
|
|
|
|
export default CustomDrawerContent;
|