1- import React from "react" ;
2- import { StyleSheet , TouchableOpacity , Linking } from "react-native" ;
3- import { Block , Text , theme } from "galio-framework" ;
1+ import { Block , Text , theme } from 'galio-framework' ;
2+ import { Linking , StyleSheet , TouchableOpacity } from 'react-native' ;
43
5- import Icon from "./Icon" ;
6- import nowTheme from "../constants/Theme" ;
4+ import Icon from './Icon' ;
5+ import React from 'react' ;
6+ import nowTheme from '../constants/Theme' ;
77
88class DrawerItem extends React . Component {
99 renderIcon = ( ) => {
1010 const { title, focused } = this . props ;
1111
1212 switch ( title ) {
13- case " Home" :
13+ case ' Home' :
1414 return (
1515 < Icon
1616 name = "app2x"
1717 family = "NowExtra"
1818 size = { 18 }
19- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
19+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
2020 style = { { opacity : 0.5 } }
2121 />
2222 ) ;
23- case " Components" :
23+ case ' Components' :
2424 return (
2525 < Icon
2626 name = "atom2x"
2727 family = "NowExtra"
2828 size = { 18 }
29- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
29+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
3030 style = { { opacity : 0.5 } }
3131 />
3232 ) ;
33- case " Articles" :
33+ case ' Articles' :
3434 return (
3535 < Icon
3636 name = "paper"
3737 family = "NowExtra"
3838 size = { 18 }
39- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
39+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
4040 style = { { opacity : 0.5 } }
4141 />
4242 ) ;
43- case " Profile" :
43+ case ' Profile' :
4444 return (
4545 < Icon
4646 name = "profile-circle"
4747 family = "NowExtra"
4848 size = { 18 }
49- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
49+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
5050 style = { { opacity : 0.5 } }
5151 />
5252 ) ;
53- case " Account" :
53+ case ' Account' :
5454 return (
5555 < Icon
5656 name = "badge2x"
5757 family = "NowExtra"
5858 size = { 18 }
59- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
59+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
6060 style = { { opacity : 0.5 } }
6161 />
6262 ) ;
63- case " Settings" :
63+ case ' Settings' :
6464 return (
6565 < Icon
6666 name = "settings-gear-642x"
6767 family = "NowExtra"
6868 size = { 18 }
69- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
69+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
7070 style = { { opacity : 0.5 } }
7171 />
7272 ) ;
73- case " Examples" :
73+ case ' Examples' :
7474 return (
7575 < Icon
7676 name = "album"
7777 family = "NowExtra"
7878 size = { 14 }
79- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
79+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
8080 />
8181 ) ;
82- case " GETTING STARTED" :
82+ case ' GETTING STARTED' :
8383 return (
8484 < Icon
8585 name = "spaceship2x"
8686 family = "NowExtra"
8787 size = { 18 }
88- style = { { borderColor : " rgba(0,0,0,0.5)" , opacity : 0.5 } }
89- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
88+ style = { { borderColor : ' rgba(0,0,0,0.5)' , opacity : 0.5 } }
89+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
9090 />
9191 ) ;
92- case " LOGOUT" :
92+ case ' LOGOUT' :
9393 return (
9494 < Icon
9595 name = "share"
9696 family = "NowExtra"
9797 size = { 18 }
98- style = { { borderColor : " rgba(0,0,0,0.5)" , opacity : 0.5 } }
99- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
98+ style = { { borderColor : ' rgba(0,0,0,0.5)' , opacity : 0.5 } }
99+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
100100 />
101101 ) ;
102102 default :
@@ -109,17 +109,17 @@ class DrawerItem extends React.Component {
109109
110110 const containerStyles = [
111111 styles . defaultStyle ,
112- focused ? [ styles . activeStyle , styles . shadow ] : null
112+ focused ? [ styles . activeStyle , styles . shadow ] : null ,
113113 ] ;
114114
115115 return (
116116 < TouchableOpacity
117117 style = { { height : 60 } }
118118 onPress = { ( ) =>
119- title == " GETTING STARTED"
120- ? Linking . openURL (
121- "https://demos.creative-tim.com/now-ui-pro-react-native/docs/"
122- ) . catch ( err => console . error ( "An error occurred" , err ) )
119+ title == ' GETTING STARTED'
120+ ? Linking . openURL ( 'https://demos.creative-tim.com/now-ui-pro-react-native/docs/' ) . catch (
121+ ( err ) => console . error ( 'An error occurred' , err )
122+ )
123123 : navigation . navigate ( title == 'LOGOUT' ? 'Onboarding' : title )
124124 }
125125 >
@@ -130,13 +130,13 @@ class DrawerItem extends React.Component {
130130 < Block row center flex = { 0.9 } >
131131 < Text
132132 style = { {
133- fontFamily : " montserrat-regular" ,
134- textTransform : " uppercase" ,
135- fontWeight : " 300"
133+ fontFamily : ' montserrat-regular' ,
134+ textTransform : ' uppercase' ,
135+ fontWeight : ' 300' ,
136136 } }
137137 size = { 12 }
138138 bold = { focused ? true : false }
139- color = { focused ? nowTheme . COLORS . PRIMARY : "white" }
139+ color = { focused ? nowTheme . COLORS . PRIMARY : 'black' }
140140 >
141141 { title }
142142 </ Text >
@@ -151,22 +151,22 @@ const styles = StyleSheet.create({
151151 defaultStyle : {
152152 paddingVertical : 15 ,
153153 paddingHorizontal : 14 ,
154- color : " white"
154+ color : ' white' ,
155155 } ,
156156 activeStyle : {
157157 backgroundColor : nowTheme . COLORS . WHITE ,
158158 borderRadius : 30 ,
159- color : " white"
159+ color : ' white' ,
160160 } ,
161161 shadow : {
162162 shadowColor : theme . COLORS . BLACK ,
163163 shadowOffset : {
164164 width : 0 ,
165- height : 2
165+ height : 2 ,
166166 } ,
167167 shadowRadius : 8 ,
168- shadowOpacity : 0.1
169- }
168+ shadowOpacity : 0.1 ,
169+ } ,
170170} ) ;
171171
172172export default DrawerItem ;
0 commit comments