import React from "react"; import { StyleSheet } from "react-native"; import { Block, Text, theme } from "galio-framework"; import Icon from "./Icon"; import argonTheme from "../constants/Theme"; class DrawerItem extends React.Component { renderIcon = () => { const { title, focused } = this.props; switch (title) { case "Home": return ( ); case "Elements": return ( ); case "Components": return ( ); case "Articles": return ( ); case "Profile": return ( ); case "Account": return ( ); case "Getting Started": return ; case "Log out": return ; default: return null; } }; render() { const { focused, title } = this.props; const containerStyles = [ styles.defaultStyle, focused ? [styles.activeStyle, styles.shadow] : null ]; return ( {this.renderIcon()} {title} ); } } const styles = StyleSheet.create({ defaultStyle: { paddingVertical: 15, paddingHorizontal: 14 }, activeStyle: { backgroundColor: argonTheme.COLORS.ACTIVE, borderRadius: 4 }, shadow: { shadowColor: theme.COLORS.BLACK, shadowOffset: { width: 0, height: 2 }, shadowRadius: 8, shadowOpacity: 0.1 } }); export default DrawerItem;