//jshint esnext:true var React = require('react'); class MainList extends React.Component { componentDidMount() { } _openOptionsPage() { if (chrome.runtime.openOptionsPage) { // New way to open options pages, if supported (Chrome 42+). chrome.runtime.openOptionsPage(); } else { // Reasonable fallback. window.open(chrome.runtime.getURL('options.html')); } } render() { var loginLogoutButton = () => { if (this.props.loggedIn === true) { return (
Logout
); } return ( Login ); }; // If logging is enabled, display that info to user var loggingStatus = () => { if(this.props.loggingEnabled === true && this.props.loggedIn === true) { return (

Disable logging

); } else if(this.props.loggingEnabled === false && this.props.loggedIn === true) { return (

Enable logging

); } }; var totalTimeLoggedToday = () => { if (this.props.loggedIn === true) { return (

{this.props.totalTimeLoggedToday}

TOTAL TIME LOGGED TODAY
); } }; return (
{totalTimeLoggedToday()} {loggingStatus()}
Options {loginLogoutButton()}
); } } export default MainList;