import React, { ReactElement, useState } from 'react'; import { StyleSheet, View } from 'react-native'; import { Avatar, Divider, Drawer, DrawerItem, DrawerElement, Layout, Text, IndexPath, } from '@ui-kitten/components'; import { BookIcon, GithubIcon } from '../../components/icons'; import { SafeAreaLayout } from '../../components/safe-area-layout.component'; import { WebBrowserService } from '../../services/web-browser.service'; import { AppInfoService } from '../../services/app-info.service'; const version: string = AppInfoService.getVersion(); export const HomeDrawer = ({ navigation }): DrawerElement => { const [selectedIndex, setSelectedIndex] = useState(null); const DATA = [ { title: 'Libraries', icon: GithubIcon, onPress: () => { navigation.toggleDrawer(); navigation.navigate('Libraries'); }, }, { title: 'Documentation', icon: BookIcon, onPress: () => { WebBrowserService.openBrowserAsync('https://akveo.github.io/react-native-ui-kitten'); navigation.toggleDrawer(); }, }, ]; const renderHeader = (): ReactElement => ( Kitten Tricks ); const renderFooter = () => ( {`Version ${AppInfoService.getVersion()}`} ); return ( setSelectedIndex(index)} > {DATA.map((el, index) => ( ))} ); }; const styles = StyleSheet.create({ safeArea: { flex: 1, }, header: { height: 128, paddingHorizontal: 16, justifyContent: 'center', }, footer: { flexDirection: 'row', justifyContent: 'flex-start', marginLeft: 16, }, profileContainer: { flexDirection: 'row', alignItems: 'center', }, profileName: { marginHorizontal: 16, }, });