2020-03-07 22:52:55 +01:00
|
|
|
import * as React from 'react';
|
|
|
|
import {withTheme} from 'react-native-paper';
|
|
|
|
import {DrawerItem} from "@react-navigation/drawer";
|
|
|
|
import {MaterialCommunityIcons} from "@expo/vector-icons";
|
|
|
|
|
2020-03-29 14:46:44 +02:00
|
|
|
/**
|
|
|
|
* Component used to render a drawer menu item
|
|
|
|
*
|
|
|
|
* @param props Props to pass to the component
|
|
|
|
* @return {*}
|
|
|
|
*/
|
2020-03-07 22:52:55 +01:00
|
|
|
function SidebarItem(props) {
|
|
|
|
const {colors} = props.theme;
|
|
|
|
return (
|
|
|
|
<DrawerItem
|
|
|
|
label={props.title}
|
|
|
|
focused={false}
|
|
|
|
onPress={props.onPress}
|
|
|
|
icon={({color, size}) =>
|
|
|
|
<MaterialCommunityIcons color={color} size={size} name={props.icon}/>}
|
|
|
|
style={{
|
|
|
|
marginLeft: 0,
|
|
|
|
marginRight: 0,
|
|
|
|
padding: 0,
|
|
|
|
borderRadius: 0,
|
|
|
|
}}
|
|
|
|
labelStyle={{
|
|
|
|
color: colors.text,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default withTheme(SidebarItem);
|