From 350110742ec70505a05fc35d28d508f701397858 Mon Sep 17 00:00:00 2001 From: Mario Basic Date: Sun, 14 Jun 2015 12:33:21 +0200 Subject: [PATCH] Added total time logged today. Changed UI. --- README.md | 6 +- assets/js/components/MainList.react.js | 56 +- assets/js/components/Navbar.react.js | 38 + assets/js/components/WakaTime.react.js | 16 +- assets/js/core/WakaTime.js | 25 + assets/js/helpers/getTodaysDateInFormat.js | 13 - package.json | 1 + public/js/bundle.js | 3953 +++++++++++++++++-- public/js/events.js | 3139 ++++++++++++++- screenshots/sc_6-green.png | Bin 0 -> 33584 bytes screenshots/sc_6-open.png | Bin 0 -> 39820 bytes screenshots/sc_6-red.png | Bin 0 -> 34012 bytes tests/helpers/getTodaysDateInFormat.spec.js | 14 - 13 files changed, 6802 insertions(+), 459 deletions(-) delete mode 100644 assets/js/helpers/getTodaysDateInFormat.js create mode 100644 screenshots/sc_6-green.png create mode 100644 screenshots/sc_6-open.png create mode 100644 screenshots/sc_6-red.png delete mode 100644 tests/helpers/getTodaysDateInFormat.spec.js diff --git a/README.md b/README.md index 6898e020..bd8b164c 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,11 @@ Installation ## Screenshots -![SC open](./screenshots/sc_5-logging-green.png) +![SC open](./screenshots/sc_6-green.png) -![SC open](./screenshots/sc_5-logging-red.png) +![SC open](./screenshots/sc_6-red.png) + +![SC open](./screenshots/sc_6-open.png) ![Options SC](./screenshots/sc_4-options.png) diff --git a/assets/js/components/MainList.react.js b/assets/js/components/MainList.react.js index d2ced81a..5ede043a 100644 --- a/assets/js/components/MainList.react.js +++ b/assets/js/components/MainList.react.js @@ -22,14 +22,6 @@ class MainList extends React.Component { if (this.props.loggedIn === true) { return (
- - - Custom Rules - - - - Dashboard - Logout @@ -51,13 +43,11 @@ class MainList extends React.Component { if(this.props.loggingEnabled === true && this.props.loggedIn === true) { return ( -
-
-
- -
+
+
); @@ -65,36 +55,26 @@ class MainList extends React.Component { else if(this.props.loggingEnabled === false && this.props.loggedIn === true) { return ( -
-
-
- -
+
+
); } }; - var signedInAs = () => { + var totalTimeLoggedToday = () => { if (this.props.loggedIn === true) { return ( -
-
-
-
- -
-
- Signed in as  - {this.props.user.full_name} -
- {this.props.user.email} -
-
- +
+
+
+

{this.props.totalTimeLoggedToday}

+ TOTAL TIME LOGGED TODAY +
); @@ -104,7 +84,7 @@ class MainList extends React.Component { return (
- {signedInAs()} + {totalTimeLoggedToday()} {loggingStatus()} diff --git a/assets/js/components/Navbar.react.js b/assets/js/components/Navbar.react.js index d742ee8d..8e33d056 100644 --- a/assets/js/components/Navbar.react.js +++ b/assets/js/components/Navbar.react.js @@ -5,6 +5,41 @@ var React = require('react'); class Navbar extends React.Component { render() { + + var signedInAs = () => { + if (this.props.loggedIn === true) { + return ( + + ); + } + }; + + var dashboard = () => { + if (this.props.loggedIn === true) { + return ( +
  • + + + Dashboard + +
  • + ); + } + }; + + var customRules = () => { + if (this.props.loggedIn === true) { + return ( +
  • + + + Custom Rules + +
  • + ); + } + }; + return (