/* @flow */ import * as React from 'react'; import { View, StyleSheet, Platform } from 'react-native'; import { Drawer, withTheme, Switch, TouchableRipple, Text, Colors, } from 'react-native-paper'; import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, toggleTheme: Function, toggleRTL: Function, isRTL: boolean, isDarkTheme: boolean, }; type State = { open: boolean, drawerItemIndex: number, }; const DrawerItemsData = [ { label: 'Inbox', icon: 'inbox', key: 0 }, { label: 'Starred', icon: 'star', key: 1 }, { label: 'Sent mail', icon: 'send', key: 2 }, { label: 'Colored label', icon: 'color-lens', key: 3 }, { label: 'A very long title that will be truncated', icon: 'delete', key: 4 }, ]; class DrawerItems extends React.Component { state = { open: false, drawerItemIndex: 0, }; _setDrawerItem = index => this.setState({ drawerItemIndex: index }); render() { const { colors } = this.props.theme; return ( {DrawerItemsData.map((props, index) => ( this._setDrawerItem(index)} /> ))} Dark Theme RTL ); } } const styles = StyleSheet.create({ drawerContent: { flex: 1, paddingTop: Platform.OS === 'android' ? 25 : 22, }, preference: { flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 12, paddingHorizontal: 16, }, }); export default withTheme(DrawerItems);