Skip to content

Commit

Permalink
Merge pull request #145 from partio-scout/feature/show-user-name-in-n…
Browse files Browse the repository at this point in the history
…avbar

Show user name in navbar
  • Loading branch information
pompost authored Jul 19, 2016
2 parents e6167d1 + 0c05b79 commit 52e144f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/client/components/App/MainNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export function getMainNavigation() {
);
}

navItems.push(
{
icon: 'user',
label: `${this.props.currentUser.firstName} ${this.props.currentUser.lastName}`,
}
);

navItems.push(
{
onClick: this.props.onLogout,
Expand Down
14 changes: 7 additions & 7 deletions src/client/components/App/NavigationItem.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { NavItem } from 'react-bootstrap';
import { NavItem, Glyphicon } from 'react-bootstrap';
import { NavLinkItem } from '../../components';

export function getNavigationItem() {
Expand All @@ -9,14 +9,14 @@ export function getNavigationItem() {
values,
} = this.props;

const label = (values.icon ? <span><Glyphicon glyph={ values.icon }/> { values.label }</span> : values.label);

if (values.isExternalLink) {
return (<NavItem href={ values.to } onClick={ values.onClick }>{ values.label }</NavItem>);
return (<NavItem href={ values.to } onClick={ values.onClick }>{ label }</NavItem>);
} else if (values.onClick || values.to) {
return (<NavLinkItem to={ values.to } isIndexLink={ values.isIndexLink }>{ label }</NavLinkItem>);
} else {
return (
<NavLinkItem to={ values.to } isIndexLink={ values.isIndexLink }>
{ values.label }
</NavLinkItem>
);
return (<NavItem disabled={ true }>{ label }</NavItem>);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/client/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ table {
font-weight: bold;
}

.navbar {
.no-link {
cursor: default !important
}
}

/**
* Sidebar & Main Container
*/
Expand Down

0 comments on commit 52e144f

Please sign in to comment.