Skip to content

Commit

Permalink
Merge branch '26-logo-href'
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenjl committed Sep 26, 2018
2 parents 63662c1 + a1f7126 commit 42dac81
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
16 changes: 15 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,26 @@ class App extends Component {
this.props.auth.logout();
}

getLogoHref = () => {
const auth = this.props.auth;
if (!auth || !auth.isAuthenticated()) {
return '/';
} else if (auth.hasFacilitatorPriviledge()) {
return '/facilitator';
} else if (auth.hasDriverPriviledge()) {
return '/driver';
} else {
return '/';
}
};

render() {
const { isAuthenticated } = this.props.auth;

return (
<div>
<nav className="navbar navbar-light bg-light">
<a className="navbar-brand" href="https://rides.carpal.org.au/">
<a className="navbar-brand" href={this.getLogoHref()}>
<img
src="/styles/carpal.png"
width="200"
Expand Down

0 comments on commit 42dac81

Please sign in to comment.