@@ -6,10 +6,12 @@ import AppBar from 'material-ui/AppBar'
6
6
import Toolbar from 'material-ui/Toolbar'
7
7
import Typography from 'material-ui/Typography'
8
8
import Badge from 'material-ui/Badge'
9
+ import Button from 'material-ui/Button'
9
10
10
11
import AuthActionCreator from '../../actions/auth'
11
12
import styles from './Header.scss'
12
13
import ApplicationActionCreator from '../../actions/application'
14
+ import logo from '../../images/logo-nav.png'
13
15
14
16
class Header extends Component {
15
17
constructor ( props ) {
@@ -28,36 +30,80 @@ class Header extends Component {
28
30
29
31
renderNotificationBadge ( ) {
30
32
const { applications } = this . props
31
- return applications &&
32
- < Link key = "show-applications" to = "/show-applications" className = { this . getLinkStyles ( 'show-project' ) } >
33
- { applications . notSeenCounter > 0 ? < Badge badgeContent = { applications . notSeenCounter } color = "primary" >
34
- < span className = { styles . applicationBadgeText } > APPLICATIONS</ span >
35
- </ Badge > : < span className = { styles . applicationBadgeText } > APPLICATIONS</ span > }
36
- </ Link >
33
+ return (
34
+ applications && (
35
+ < Link
36
+ key = "show-applications"
37
+ to = "/show-applications"
38
+ className = { this . getLinkStyles ( 'show-project' ) }
39
+ >
40
+ { applications . notSeenCounter > 0 ? (
41
+ < Badge badgeContent = { applications . notSeenCounter } color = "primary" >
42
+ < span className = { styles . applicationBadgeText } > APPLICATIONS</ span >
43
+ </ Badge >
44
+ ) : (
45
+ < span className = { styles . applicationBadgeText } > APPLICATIONS</ span >
46
+ ) }
47
+ </ Link >
48
+ )
49
+ )
37
50
}
38
51
39
52
renderHeaderButtons ( ) {
40
53
if ( this . props . authenticated ) {
41
54
const authButtons = [
42
- < Link key = "logout" to = '/' onClick = { this . props . logout } className = { this . getLinkStyles ( ) } > LOG OUT</ Link > ,
43
- < Link key = "profile" to = "/profile" className = { this . getLinkStyles ( 'profile' ) } > PROFILE</ Link >
55
+ < Link
56
+ key = "logout"
57
+ to = "/"
58
+ onClick = { this . props . logout }
59
+ className = { this . getLinkStyles ( ) }
60
+ >
61
+ LOG OUT
62
+ </ Link > ,
63
+ < Link
64
+ key = "profile"
65
+ to = "/profile"
66
+ className = { this . getLinkStyles ( 'profile' ) }
67
+ >
68
+ PROFILE
69
+ </ Link >
44
70
]
45
71
if ( this . props . user . usertype === 'contact' ) {
46
72
return [
47
73
this . renderNotificationBadge ( ) ,
48
- < Link key = "create-project" to = "/create-project" className = { this . getLinkStyles ( 'create-project' ) } > CREATE PROJECT</ Link > ,
74
+ < Link
75
+ key = "create-project"
76
+ to = "/create-project"
77
+ className = { this . getLinkStyles ( 'create-project' ) }
78
+ >
79
+ CREATE PROJECT
80
+ </ Link > ,
49
81
...authButtons
50
82
]
51
83
} else {
52
84
return authButtons
53
85
}
54
86
} else {
55
- return (
56
- < div >
57
- < Link key = "signup" to = "/signup" className = { this . getLinkStyles ( 'signup' ) } > SIGN UP</ Link >
58
- < Link key = "login" to = '/login' className = { this . getLinkStyles ( 'login' ) } > LOG IN</ Link >
59
- </ div >
60
- )
87
+ return [
88
+ < Link
89
+ key = "projects"
90
+ to = "/projects"
91
+ className = { this . getLinkStyles ( 'projects' ) }
92
+ >
93
+ PROJECTS
94
+ </ Link > ,
95
+ < Link key = "login" to = "/login" className = { this . getLinkStyles ( 'login' ) } >
96
+ LOG IN
97
+ </ Link > ,
98
+ < Button
99
+ key = "signup"
100
+ to = "/signup"
101
+ component = { Link }
102
+ className = { styles . navButton }
103
+ >
104
+ SIGN UP
105
+ </ Button >
106
+ ]
61
107
}
62
108
}
63
109
@@ -71,12 +117,17 @@ class Header extends Component {
71
117
return (
72
118
< div className = { styles . headerRoot } >
73
119
< AppBar position = "static" color = "inherit" elevation = { 0 } >
74
- < Toolbar >
120
+ < Toolbar style = { { height : '128px' } } >
75
121
< Typography type = "title" color = "inherit" className = { styles . flex } >
76
- < Link to = "/" className = { styles . button } > calltocode</ Link >
122
+ < Link to = "/" >
123
+ < img
124
+ src = { logo }
125
+ alt = "Calltocode logo"
126
+ className = { styles . navLogo }
127
+ />
128
+ </ Link >
77
129
</ Typography >
78
130
{ this . renderHeaderButtons ( ) }
79
- < Link key = "about" to = "/about" className = { this . getLinkStyles ( 'about' ) } > ABOUT</ Link >
80
131
</ Toolbar >
81
132
</ AppBar >
82
133
</ div >
@@ -111,7 +162,6 @@ Header.propTypes = {
111
162
notSeenCounter : PropTypes . number
112
163
} ) ,
113
164
getNotifications : PropTypes . func
114
-
115
165
}
116
166
117
167
export default connect ( mapStateToProps , mapDispatchToProps ) ( Header )
0 commit comments