@@ -34,31 +34,35 @@ export default class extends React.Component<{
34
34
route :string , position :CR . Position , routeToProgress ?:any , routeToPage ?:any , routeToProjects ?:any , quit ?:any
35
35
} , { } > {
36
36
navOptions ( ) :React . ReactElement < { } > {
37
+ const { routeToProgress, routeToPage} = this . props ;
37
38
switch ( this . props . route ) {
38
39
case 'page' :
39
- return < button onTouchTap = { this . props . routeToProgress } > progress</ button > ;
40
+ return < button onTouchTap = { routeToProgress } > progress</ button > ;
40
41
case 'progress' :
41
- return < button onTouchTap = { this . props . routeToPage } > page</ button > ;
42
+ return < button onTouchTap = { routeToPage } > page</ button > ;
42
43
default :return null ;
43
44
}
44
45
}
45
46
menuOptions ( ) {
47
+ const { routeToProgress, routeToProjects} = this . props ;
46
48
switch ( this . props . route ) {
47
49
case 'page' :
48
50
return (
49
51
< div >
50
- < MenuItem primaryText = 'progress' onTouchTap = { this . props . routeToProgress } key = 'progress' />
51
- < MenuItem primaryText = 'projects' onTouchTap = { this . props . routeToProjects } key = 'projects' />
52
+ < MenuItem primaryText = 'progress' onTouchTap = { routeToProgress } key = 'progress' />
53
+ < MenuItem primaryText = 'projects' onTouchTap = { routeToProjects } key = 'projects' />
52
54
</ div > ) ;
53
55
case 'progress' :
54
- return < MenuItem primaryText = 'projects' onTouchTap = { this . props . routeToProjects } key = 'projects' /> ;
56
+ return < MenuItem primaryText = 'projects' onTouchTap = { routeToProjects } key = 'projects' /> ;
55
57
default :return null ;
56
58
}
57
59
}
58
60
closePanel ( ) {
59
61
togglePanel ( ) ;
60
62
}
61
63
render ( ) :React . ReactElement < { } > {
64
+ const origin = { horizontal :'right' , vertical :'top' } ;
65
+ const { quit} = this . props ;
62
66
return (
63
67
< AppBar title = { 'CodeRoad' }
64
68
className = 'cr-menu-bar'
@@ -68,20 +72,19 @@ export default class extends React.Component<{
68
72
iconButtonElement = {
69
73
< IconButton > < MoreVertIcon /> </ IconButton >
70
74
}
71
- targetOrigin = { { horizontal :'right' , vertical :'top' } }
72
- anchorOrigin = { { horizontal :'right' , vertical :'top' } }
73
- >
75
+ targetOrigin = { origin }
76
+ anchorOrigin = { origin } >
74
77
{ /* Menu Items */ }
75
78
{ this . menuOptions ( ) }
76
- { }
79
+
77
80
{ window . coderoad . issuesPath ?< MenuItem key = 'issue' >
78
81
< a href = { window . coderoad . issuesPath } >
79
82
post issue
80
83
</ a >
81
84
</ MenuItem > :null }
82
85
83
86
< Divider />
84
- < MenuItem primaryText = 'quit' onTouchTap = { this . props . quit } />
87
+ < MenuItem primaryText = 'quit' onTouchTap = { quit } />
85
88
86
89
</ IconMenu >
87
90
} />