Skip to content

Commit fbc9ef5

Browse files
razwanizmibbmoz
authored andcommitted
Change navbar to new design (#190)
1 parent 4262edd commit fbc9ef5

File tree

3 files changed

+107
-31
lines changed

3 files changed

+107
-31
lines changed

client/components/Header/Header.js

Lines changed: 69 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import AppBar from 'material-ui/AppBar'
66
import Toolbar from 'material-ui/Toolbar'
77
import Typography from 'material-ui/Typography'
88
import Badge from 'material-ui/Badge'
9+
import Button from 'material-ui/Button'
910

1011
import AuthActionCreator from '../../actions/auth'
1112
import styles from './Header.scss'
1213
import ApplicationActionCreator from '../../actions/application'
14+
import logo from '../../images/logo-nav.png'
1315

1416
class Header extends Component {
1517
constructor (props) {
@@ -28,36 +30,80 @@ class Header extends Component {
2830

2931
renderNotificationBadge () {
3032
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+
)
3750
}
3851

3952
renderHeaderButtons () {
4053
if (this.props.authenticated) {
4154
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>
4470
]
4571
if (this.props.user.usertype === 'contact') {
4672
return [
4773
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>,
4981
...authButtons
5082
]
5183
} else {
5284
return authButtons
5385
}
5486
} 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+
]
61107
}
62108
}
63109

@@ -71,12 +117,17 @@ class Header extends Component {
71117
return (
72118
<div className={styles.headerRoot}>
73119
<AppBar position="static" color="inherit" elevation={0}>
74-
<Toolbar>
120+
<Toolbar style={{ height: '128px' }}>
75121
<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>
77129
</Typography>
78130
{this.renderHeaderButtons()}
79-
<Link key="about" to="/about" className={this.getLinkStyles('about')}>ABOUT</Link>
80131
</Toolbar>
81132
</AppBar>
82133
</div>
@@ -111,7 +162,6 @@ Header.propTypes = {
111162
notSeenCounter: PropTypes.number
112163
}),
113164
getNotifications: PropTypes.func
114-
115165
}
116166

117167
export default connect(mapStateToProps, mapDispatchToProps)(Header)

client/components/Header/Header.scss

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
@import '../../scss/partials/partials';
22

33
.headerRoot {
4-
width: 100%;
4+
height: 128px;
55
margin-bottom: 2px;
6+
margin-left: calc((100vw - 1060px) / -2);
7+
width: calc(100vw - 100px);
68

79
&:after {
810
content: '';
911
position: absolute;
1012
width: 100%;
11-
top: 64px;
13+
top: 128px;
1214
left: 0;
1315
height: 2px;
1416
background: #F9F9F9;
@@ -20,23 +22,47 @@
2022
}
2123

2224
.button {
23-
padding: 10px;
24-
margin-left: 10px;
25-
color: dimgray;
25+
margin-left: 40px;
26+
color: #ed4b30;
27+
font-size: 14px;
28+
font-weight: bold;
29+
letter-spacing: 2.3px;
30+
padding-bottom: 5px;
31+
border-bottom: solid 3px transparent;
2632

27-
&.active, &:active {
28-
@extend %buttonActive;
29-
}
30-
31-
&:hover {
32-
@extend %hover;
33+
&.active, &:active, &:hover {
34+
border-bottom-color: #ed4b30;
3335
}
3436
}
3537

3638
.disabled {
3739
pointer-events: none;
3840
opacity: 0.6;
3941
}
42+
4043
.applicationBadgeText {
41-
padding: 0 15px;
44+
padding: 0;
45+
}
46+
47+
.navLogo {
48+
height: 32px;
49+
}
50+
51+
a.navButton {
52+
background: #ed4b30;
53+
border-radius: 49.5px;
54+
margin-left: 40px;
55+
padding: 13px 28px;
56+
57+
&:active,
58+
&:focus,
59+
&:hover {
60+
background: #ed4b30;
61+
}
62+
63+
span {
64+
color: #ffffff;
65+
font-size: 14px;
66+
letter-spacing: 2.3px;
67+
}
4268
}

client/images/logo-nav.png

66.4 KB
Loading

0 commit comments

Comments
 (0)