import React from 'react'; import {Platform, Dimensions, StyleSheet, Image, FlatList} from 'react-native'; import {Badge, Text, Container, Content, Icon, Left, ListItem, Right} from "native-base"; import i18n from "i18n-js"; const deviceHeight = Dimensions.get("window").height; const drawerCover = require("../assets/drawer-cover.png"); export default class SideBar extends React.Component { constructor(props) { super(props); this.state = { active: 'Home', }; this.dataSet = [ { name: i18n.t('screens.home'), route: "Home", icon: "home", bg: "#C5F442" // types: "11" // Shows the badge }, { name: i18n.t('screens.planning'), route: "Planning", icon: "calendar-range", bg: "#477EEA", // types: "11" }, { name: "Proxiwash", route: "Proxiwash", icon: "washing-machine", bg: "#477EEA", // types: "11" }, { name: "Proximo", route: "Proximo", icon: "shopping", bg: "#477EEA", // types: "11" }, { name: i18n.t('screens.settings'), route: "Settings", icon: "settings", bg: "#477EEA", // types: "11" }, { name: i18n.t('screens.about'), route: "About", icon: "information", bg: "#477EEA", // types: "11" }, ]; } navigateToScreen = (route) => () => { this.props.navigation.navigate(route); this.props.navigation.closeDrawer(); this.setState({active: route}); }; render() { return ( item.route} renderItem={({item}) => {item.name} {item.types && {`${item.types} Types`} } } /> ); } } const styles = StyleSheet.create({ drawerCover: { alignSelf: "stretch", height: deviceHeight / 4, width: null, position: "relative", marginBottom: 10, marginTop: 20 }, text: { fontWeight: Platform.OS === "ios" ? "500" : "400", fontSize: 16, marginLeft: 20 }, badgeText: { fontSize: Platform.OS === "ios" ? 13 : 11, fontWeight: "400", textAlign: "center", marginTop: Platform.OS === "android" ? -3 : undefined } });