11import React from "react" ;
2- import { StyleSheet } from "react-native" ;
2+ import { StyleSheet , TouchableOpacity } from "react-native" ;
33import { Block , Text , theme } from "galio-framework" ;
44
55import Icon from "./Icon" ;
@@ -15,7 +15,7 @@ class DrawerItem extends React.Component {
1515 < Icon
1616 name = "shop"
1717 family = "ArgonExtra"
18- size = { 10 }
18+ size = { 14 }
1919 color = { focused ? "white" : argonTheme . COLORS . PRIMARY }
2020 />
2121 ) ;
@@ -24,7 +24,7 @@ class DrawerItem extends React.Component {
2424 < Icon
2525 name = "map-big"
2626 family = "ArgonExtra"
27- size = { 12 }
27+ size = { 14 }
2828 color = { focused ? "white" : argonTheme . COLORS . ERROR }
2929 />
3030 ) ;
@@ -33,7 +33,7 @@ class DrawerItem extends React.Component {
3333 < Icon
3434 name = "spaceship"
3535 family = "ArgonExtra"
36- size = { 12 }
36+ size = { 14 }
3737 color = { focused ? "white" : argonTheme . COLORS . PRIMARY }
3838 />
3939 ) ;
@@ -42,7 +42,7 @@ class DrawerItem extends React.Component {
4242 < Icon
4343 name = "chart-pie-35"
4444 family = "ArgonExtra"
45- size = { 12 }
45+ size = { 14 }
4646 color = { focused ? "white" : argonTheme . COLORS . WARNING }
4747 />
4848 ) ;
@@ -51,12 +51,17 @@ class DrawerItem extends React.Component {
5151 < Icon
5252 name = "calendar-date"
5353 family = "ArgonExtra"
54- size = { 12 }
54+ size = { 14 }
5555 color = { focused ? "white" : argonTheme . COLORS . INFO }
5656 />
5757 ) ;
5858 case "Getting Started" :
59- return < Icon /> ;
59+ return ( < Icon
60+ name = "spaceship"
61+ family = "ArgonExtra"
62+ size = { 14 }
63+ color = { focused ? "white" : "rgba(0,0,0,0.5)" }
64+ /> ) ;
6065 case "Log out" :
6166 return < Icon /> ;
6267 default :
@@ -65,36 +70,47 @@ class DrawerItem extends React.Component {
6570 } ;
6671
6772 render ( ) {
68- const { focused, title } = this . props ;
73+ const { focused, title, navigation } = this . props ;
6974
7075 const containerStyles = [
7176 styles . defaultStyle ,
7277 focused ? [ styles . activeStyle , styles . shadow ] : null
7378 ] ;
7479
7580 return (
76- < Block flex row style = { containerStyles } >
77- < Block middle flex = { 0.1 } style = { { marginRight : 5 } } >
78- { this . renderIcon ( ) }
79- </ Block >
80- < Block row center flex = { 0.9 } >
81- < Text
82- size = { 15 }
83- bold = { focused ? true : false }
84- color = { focused ? "white" : "rgba(0,0,0,0.5)" }
85- >
86- { title }
87- </ Text >
81+ < TouchableOpacity
82+ style = { { height : 60 } }
83+ onPress = { ( ) =>
84+ title == "Getting Started"
85+ ? Linking . openURL (
86+ "https://demos.creative-tim.com/argon-pro-react-native/docs/"
87+ ) . catch ( err => console . error ( "An error occurred" , err ) )
88+ : navigation . navigate ( title )
89+ }
90+ >
91+ < Block flex row style = { containerStyles } >
92+ < Block middle flex = { 0.1 } style = { { marginRight : 5 } } >
93+ { this . renderIcon ( ) }
94+ </ Block >
95+ < Block row center flex = { 0.9 } >
96+ < Text
97+ size = { 15 }
98+ bold = { focused ? true : false }
99+ color = { focused ? "white" : "rgba(0,0,0,0.5)" }
100+ >
101+ { title }
102+ </ Text >
103+ </ Block >
88104 </ Block >
89- </ Block >
105+ </ TouchableOpacity >
90106 ) ;
91107 }
92108}
93109
94110const styles = StyleSheet . create ( {
95111 defaultStyle : {
96- paddingVertical : 15 ,
97- paddingHorizontal : 14
112+ paddingVertical : 16 ,
113+ paddingHorizontal : 16
98114 } ,
99115 activeStyle : {
100116 backgroundColor : argonTheme . COLORS . ACTIVE ,
0 commit comments