From d9d81925299aa787cbdb815cb4b06e17a412b40c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 20 Mar 2017 01:59:47 +0100 Subject: filter by date --- client/components/LoggedInView.jsx | 64 +------------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) (limited to 'client/components/LoggedInView.jsx') diff --git a/client/components/LoggedInView.jsx b/client/components/LoggedInView.jsx index 5c7a690..3fa3e8b 100644 --- a/client/components/LoggedInView.jsx +++ b/client/components/LoggedInView.jsx @@ -1,5 +1,6 @@ import React from 'react' import ModalDialog from './ModalDialog.jsx' +import Menu from './Menu.jsx' import UserList from './UserList.jsx' import MealList from './MealList.jsx' @@ -45,66 +46,3 @@ export default class LoggedInView extends React.Component { } -class Menu extends React.Component { - constructor() { - super() - this.setGoal = this.setGoal.bind(this) - this.logout = this.logout.bind(this) - } - setGoal() { - const goal = Math.abs(parseInt(prompt('Please enter your calorie goal', this.props.user.goal))) - if (goal) { - client.service('users').patch(this.props.user.id, { - goal: goal, - token: client.get('token'), - }).then((user) => { - this.props.updateUser(user) - }) - } - } - logout() { - client.logout().then(() => { - window.location.reload() - }) - } - render() { - const user = this.props.user - const items = [] - items.push(
  • Hello {user.email}
  • ) - items.push(
  • Goal: {user.goal}
  • ) - switch (user.role) { - case 'admin': - if (this.props.user.id !== this.props.currentUser.id) { - items.push(
  • Reset User
  • ) - } - items.push(
  • Users
  • ) - items.push(
  • Meals
  • ) - break - case 'manager': - items.push(
  • Users
  • ) - items.push(
  • Meals
  • ) - case 'user': - break - } - items.push(
  • Logout
  • ) - - return ( -
    - -
    - ) - // {}} /> - } -} - - -// class ProfileModal extends React.Component { -// render() { -// return ( -// -// -// ) -// } -// } -- cgit v1.2.3-70-g09d2