summaryrefslogtreecommitdiff
path: root/client/components/Menu.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/Menu.jsx')
-rw-r--r--client/components/Menu.jsx13
1 files changed, 10 insertions, 3 deletions
diff --git a/client/components/Menu.jsx b/client/components/Menu.jsx
index d53803d..471336e 100644
--- a/client/components/Menu.jsx
+++ b/client/components/Menu.jsx
@@ -27,10 +27,17 @@ export default class Menu extends React.Component {
}
render() {
const user = this.props.user
+ const currentUser = this.props.currentUser
+ const observing = user.id !== currentUser.id
const items = []
- items.push( <li key='hello'>Hello {user.email}</li> )
- items.push( <li key='goal' onClick={this.setGoal}><a href='#'>Goal</a>: {user.goal}</li> )
- switch (user.role) {
+ if (observing) {
+ items.push( <li key='observing'><i>Viewing</i> {user.email}</li> )
+ }
+ else {
+ items.push( <li key='hello'>Hello {currentUser.email}</li> )
+ }
+ items.push( <li key='goal' onMouseDown={this.setGoal}><a href='#'>Goal</a>: {user.goal} cal</li> )
+ switch (currentUser.role) {
case 'admin':
if (this.props.user.id !== this.props.currentUser.id) {
items.push( <li key='resetUser'><a href='#' onClick={this.resetUser}>Reset User</a></li> )