diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 31e9290..7d3c7cb 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -1,7 +1,7 @@ import 'whatwg-fetch'; import 'bluebird'; -import Config from '../config'; +import _config from '../config'; import { startCurrencyAssetChain, startAssetChain, @@ -12,6 +12,14 @@ import { import { copyToClipboard } from '../util/copyToClipboard'; import { translate } from '../translate/translate'; +let Config; + +try { + Config = window.require('electron').remote.getCurrentWindow(); +} catch (e) { + Config = _config; +} + export const TOASTER_MESSAGE = 'TOASTER_MESSAGE'; export const DISPLAY_ADDCOIN_MODAL = 'DISPLAY_ADDCOIN_MODAL'; export const GET_ACTIVE_COINS = 'GET_ACTIVE_COINS'; @@ -3423,7 +3431,6 @@ export function getAgamaLog(type) { } export function guiLogState(logData) { - console.log(logData); return { type: LOG_GUI_HTTP, timestamp: logData.timestamp, diff --git a/react/src/components/dashboard/about.js b/react/src/components/dashboard/about.js index f671f59..91c5564 100644 --- a/react/src/components/dashboard/about.js +++ b/react/src/components/dashboard/about.js @@ -3,7 +3,7 @@ import { translate } from '../../translate/translate'; class About extends React.Component { render() { - return( + return (

About Iguana

diff --git a/react/src/components/dashboard/dashboard.js b/react/src/components/dashboard/dashboard.js index dfd94b8..06c69fe 100644 --- a/react/src/components/dashboard/dashboard.js +++ b/react/src/components/dashboard/dashboard.js @@ -3,7 +3,6 @@ import Navbar from './navbar'; import CoinTile from './coinTile'; import EDEX from './edex'; import WalletsBalance from './walletsBalance'; -import WalletsHeader from './walletsHeader'; import WalletsProgress from './walletsProgress'; import WalletsNav from './walletsNav'; import SendCoin from './sendCoin'; diff --git a/react/src/components/dashboard/jumblr.js b/react/src/components/dashboard/jumblr.js index 4f13110..fbe0577 100644 --- a/react/src/components/dashboard/jumblr.js +++ b/react/src/components/dashboard/jumblr.js @@ -1,5 +1,6 @@ import React from 'react'; import { translate } from '../../translate/translate'; +import WalletsHeader from './walletsHeader'; /*import { dashboardChangeSection, toggleAddcoinModal, logout } from '../../actions/actionCreators'; import Store from '../../store';*/ @@ -31,7 +32,8 @@ class Jumblr extends React.Component { render() { return (
-
+ +
diff --git a/react/src/components/dashboard/navbar.js b/react/src/components/dashboard/navbar.js index 18f1779..58f87f4 100644 --- a/react/src/components/dashboard/navbar.js +++ b/react/src/components/dashboard/navbar.js @@ -100,8 +100,7 @@ class Navbar extends React.Component {
  • + className={ this.props.Dashboard.activeSection === 'jumblr' ? 'active nav-top-menu' : 'nav-top-menu' }> this.dashboardChangeSection('jumblr') }> Jumblr diff --git a/react/src/components/dashboard/notifications.js b/react/src/components/dashboard/notifications.js new file mode 100644 index 0000000..3183afd --- /dev/null +++ b/react/src/components/dashboard/notifications.js @@ -0,0 +1,63 @@ +import React from 'react'; +import { translate } from '../../translate/translate'; + +class Notifications extends React.Component { + constructor(props) { + super(props); + this.state = { + displayModal: false, + totalCalls: 0, + totalErrorCalls: 0, + totalSuccessCalls: 0, + totalPendingCalls: 0, + }; + this.toggleNotificationsModal = this.toggleNotificationsModal.bind(this); + } + + componentWillReceiveProps(props) { + // get total number of calls per type + if (this.props.Dashboard && + this.props.Dashboard.guiLog) { + const _guiLog = this.props.Dashboard.guiLog; + let totalCalls = Object.keys(_guiLog).length; + let totalErrorCalls = 0; + let totalSuccessCalls = 0; + let totalPendingCalls = 0; + + for (let timestamp in _guiLog) { + if (_guiLog[timestamp].status === 'error') { + totalErrorCalls++; + } + if (_guiLog[timestamp].status === 'success') { + totalSuccessCalls++; + } + if (_guiLog[timestamp].status === 'pending') { + totalPendingCalls++; + } + } + + this.setState(Object.assign({}, this.state, { + totalCalls, + totalErrorCalls, + totalSuccessCalls, + totalPendingCalls, + })); + } + } + + toggleNotificationsModal() { + + } + + render() { + return ( +
    + { this.state.totalSuccessCalls } + { this.state.totalErrorCalls } + { this.state.totalPendingCalls } +
    + ); + } +} + +export default Notifications; \ No newline at end of file diff --git a/react/src/components/dashboard/walletsHeader.js b/react/src/components/dashboard/walletsHeader.js index 74af1d6..510180b 100644 --- a/react/src/components/dashboard/walletsHeader.js +++ b/react/src/components/dashboard/walletsHeader.js @@ -6,14 +6,20 @@ import { translate } from '../../translate/translate'; class WalletsHeader extends React.Component { render() { if (this.props && - this.props.coin) { + this.props.activeSection) { return ( -
    -

    EasyDEX

    +
    +

    EasyDEX

      -
    1. { translate('INDEX.DASHBOARD') }
    2. +
    3. { translate('INDEX.DASHBOARD') }
    4. +
    5. +
      { translate('SIDEBAR.JUMBLR_MOTTO') } +
    -
    +
    -
    +
    -
    +
    -
    +
    - BTC diff --git a/react/src/components/main/walletMain.js b/react/src/components/main/walletMain.js index d53d560..c9bdb6f 100644 --- a/react/src/components/main/walletMain.js +++ b/react/src/components/main/walletMain.js @@ -4,6 +4,7 @@ import AddCoin from '../addcoin/addcoin'; import Login from '../login/login'; import Dashboard from '../dashboard/dashboard'; import SyncOnly from '../dashboard/syncOnly'; +import Notifications from '../dashboard/notifications'; class WalletMain extends React.Component { render() { @@ -14,6 +15,7 @@ class WalletMain extends React.Component { +
    ); } diff --git a/react/src/reducers/dashboard.js b/react/src/reducers/dashboard.js index ec27c59..5b5f69e 100644 --- a/react/src/reducers/dashboard.js +++ b/react/src/reducers/dashboard.js @@ -7,7 +7,8 @@ import { BASILISK_CONNECTION, DASHBOARD_CONNECT_NOTARIES, VIEW_CACHE_DATA, - LOG_GUI_HTTP + LOG_GUI_HTTP, + TOGGLE_NOTIFICATIONS_MODAL } from '../actions/actionCreators'; export function Dashboard(state = { @@ -69,12 +70,15 @@ export function Dashboard(state = { case LOG_GUI_HTTP: let _guiLogState = state.guiLog; - if (_guiLogState[state.timestamp]) { - _guiLogState[state.timestamp].status = state.log.status; + if (_guiLogState[action.timestamp]) { + _guiLogState[action.timestamp].status = action.log.status; + _guiLogState[action.timestamp].response = action.log.response; + } else { + _guiLogState[action.timestamp] = action.log; } return Object.assign({}, state, { - //displayViewCacheModal: action.display, + guiLog: _guiLogState, }); default: return state; diff --git a/react/src/styles/index.scss b/react/src/styles/index.scss index d3860b4..7803f51 100644 --- a/react/src/styles/index.scss +++ b/react/src/styles/index.scss @@ -375,6 +375,42 @@ input:checked + .slider:before { text-align: center; } +.breadcrumb>li+li:before { + display: none; +} + +.notifications { + +} + +.notifications-badge { + position: absolute; + bottom: 10px; + left: 5px; + cursor: pointer; + + .badge { + margin-left: 2px; + font-weight: bold; + } + + .badge.success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; + } + .badge.pending { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; + } + .badge.error { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; + } +} + /*.toaster .single-toast:nth-child(0) { bottom: 12px; }