From ce2c2febebdda1ca7f11c87e7d0c78eda11f2878 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 7 Apr 2017 10:37:12 +0300 Subject: [PATCH] updated dashboard components --- react/src/actions/actionCreators.js | 29 +- react/src/components/app/app.js | 1 + react/src/components/dashboard/about.js | 17 + react/src/components/dashboard/atomic.js | 4 - react/src/components/dashboard/dashboard.js | 8 +- react/src/components/dashboard/edex.js | 2 +- react/src/components/dashboard/navbar.js | 8 +- react/src/components/dashboard/receiveCoin.js | 939 +++++++++--------- react/src/components/dashboard/sendCoin.js | 1 - react/src/components/dashboard/settings.js | 75 +- react/src/components/dashboard/walletsNav.js | 10 +- react/src/reducers/activeCoin.js | 8 +- react/src/reducers/atomic.js | 2 +- react/src/reducers/index.js | 2 + react/src/reducers/main.js | 3 +- react/src/reducers/settings.js | 18 + react/src/styles/index.scss | 12 + 17 files changed, 612 insertions(+), 527 deletions(-) create mode 100644 react/src/components/dashboard/about.js create mode 100644 react/src/reducers/settings.js diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 997e12d..016d276 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -16,6 +16,7 @@ export const DASHBOARD_ACTIVE_COIN_SEND_FORM = 'DASHBOARD_ACTIVE_COIN_SEND_FORM' export const DASHBOARD_ACTIVE_COIN_RECEIVE_FORM = 'DASHBOARD_ACTIVE_COIN_RECEIVE_FORM'; export const DASHBOARD_ACTIVE_COIN_RESET_FORMS = 'DASHBOARD_ACTIVE_COIN_RESET_FORMS'; export const ATOMIC = 'ATOMIC'; +export const GET_WIF_KEY = 'GET_WIF_KEY'; function atomicState(json) { return { @@ -421,13 +422,39 @@ export function atomic(payload) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster(true, payload.method, 'Atomic explorer error', 'error')) + dispatch(triggerToaster(true, payload.method, 'Atomic explore error', 'error')) }) .then(response => response.json()) .then(json => dispatch(atomicState(json))); } } +export function test(json) { + console.log('test', json); +} + +export function encryptWallet(_passphrase, cb) { + const payload = { + 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), + 'agent': 'bitcoinrpc', + 'method': 'encryptwallet', + 'passphrase': _passphrase + }; + + return dispatch => { + return fetch('http://127.0.0.1:7778', { + method: 'POST', + body: JSON.stringify(payload), + }) + .catch(function(error) { + console.log(error); + dispatch(triggerToaster(true, 'encryptWallet', 'Error', 'error')) + }) + .then(response => response.json()) + .then(json => dispatch(cb.call(this, json))); + } +} + /*function Shepherd_SysInfo() { return new Promise((resolve) => { $.ajax({ diff --git a/react/src/components/app/app.js b/react/src/components/app/app.js index d011c8d..b03538f 100644 --- a/react/src/components/app/app.js +++ b/react/src/components/app/app.js @@ -11,6 +11,7 @@ function mapStateToProps(state) { Dashboard: state.Dashboard, ActiveCoin: state.ActiveCoin, Atomic: state.Atomic, + Settings: state.Settings, }; } diff --git a/react/src/components/dashboard/about.js b/react/src/components/dashboard/about.js new file mode 100644 index 0000000..3f11be5 --- /dev/null +++ b/react/src/components/dashboard/about.js @@ -0,0 +1,17 @@ +import React from 'react'; +import { translate } from '../../translate/translate'; + +class About extends React.Component { + render() { + return( +
+
+

About Iguana

+

Page content goes here

+
+
+ ); + } +} + +export default About; diff --git a/react/src/components/dashboard/atomic.js b/react/src/components/dashboard/atomic.js index 88aa7e8..b1f331a 100644 --- a/react/src/components/dashboard/atomic.js +++ b/react/src/components/dashboard/atomic.js @@ -25,21 +25,18 @@ class Atomic extends React.Component { this.setState(Object.assign({}, this.state, { 'api': e.target.value, })); - console.log('this', this.state); } updateSelectedCoin(e) { this.setState(Object.assign({}, this.state, { 'coin': e.target.value.split('|')[0], })); - console.log('this', this.state); } updateInput(e) { this.setState(Object.assign({}, this.state, { 'input': e.target.value, })); - console.log('this', this.state); } getAtomicData() { @@ -326,7 +323,6 @@ class Atomic extends React.Component { } componentWillReceiveProps(props) { - console.log('atomicprops', props.Atomic.response); if (props && props.Atomic.response) { if (this.state.api === 'txid' || this.state.api === 'dex_getbestblockhash' || diff --git a/react/src/components/dashboard/dashboard.js b/react/src/components/dashboard/dashboard.js index 7ad645e..90782db 100644 --- a/react/src/components/dashboard/dashboard.js +++ b/react/src/components/dashboard/dashboard.js @@ -11,6 +11,8 @@ import WalletsData from './walletsData'; import Atomic from './atomic'; import Jumblr from './jumblr'; import Settings from './settings'; +import ReceiveCoin from './receiveCoin'; +import About from './about'; class Dashboard extends React.Component { constructor(props) { @@ -21,7 +23,7 @@ class Dashboard extends React.Component { } renderDashboard() { - document.body.className = 'page-login'; + document.body.className = ''; // return (
@@ -33,6 +35,7 @@ class Dashboard extends React.Component { +
@@ -47,6 +50,9 @@ class Dashboard extends React.Component {
+
+ +
); diff --git a/react/src/components/dashboard/edex.js b/react/src/components/dashboard/edex.js index 4563481..1f966f3 100644 --- a/react/src/components/dashboard/edex.js +++ b/react/src/components/dashboard/edex.js @@ -4,7 +4,7 @@ import { translate } from '../../translate/translate'; class EDEX extends React.Component { render() { return ( -
+

Coming Soon!

diff --git a/react/src/components/dashboard/navbar.js b/react/src/components/dashboard/navbar.js index 67cf3d2..d817180 100644 --- a/react/src/components/dashboard/navbar.js +++ b/react/src/components/dashboard/navbar.js @@ -66,22 +66,22 @@ class Navbar extends React.Component { -
  • +
  • this.dashboardChangeSection('wallets')}> {translate('INDEX.WALLETS')}
  • -
  • +
  • this.dashboardChangeSection('edex')}> EasyDEX
  • -
  • +
  • this.dashboardChangeSection('jumblr')}> Jumblr
  • -
  • +
  • this.dashboardChangeSection('atomic')}> Atomic Explorer diff --git a/react/src/components/dashboard/receiveCoin.js b/react/src/components/dashboard/receiveCoin.js index de0e39d..973a9f1 100644 --- a/react/src/components/dashboard/receiveCoin.js +++ b/react/src/components/dashboard/receiveCoin.js @@ -3,565 +3,554 @@ import { translate } from '../../translate/translate'; class ReceiveCoin extends React.Component { render() { - return ( -
    -
    - - - + console.log('receiveprops', this.props); + if (this.props && this.props.receive) { + return ( +
    +
    + -
    -
    -
    -
    - - | - / - | : - -
    -
    + -
    -
    -
    -
    -
    -
    -
    -
    -
    - {translate('INDEX.TRANSPARENT_BALANCE')} -
    - - -
    -
    +
    +
    +
    +
    + - | - / - | : -
    +
    -
    -
    -
    -
    -
    -
    - {translate('INDEX.Z_BALANCE')} +
    +
    +
    +
    +
    +
    +
    +
    + {translate('INDEX.TRANSPARENT_BALANCE')} +
    + -
    - -
    -
    -
    -
    -
    -
    -
    -
    - {translate('INDEX.INTEREST_EARNED')} +
    +
    +
    +
    +
    +
    + {translate('INDEX.Z_BALANCE')} +
    + -
    - -
    -
    -
    -
    -
    -
    -
    -
    - {translate('INDEX.ZT_BALANCE')} +
    +
    +
    +
    +
    +
    + {translate('INDEX.INTEREST_EARNED')} +
    + -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    {translate('INDEX.TRANSACTION_HISTORY')}

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    {translate('INDEX.TYPE')}{translate('INDEX.DIRECTION')}{translate('INDEX.CONFIRMATIONS')}{translate('INDEX.AMOUNT')}{translate('INDEX.TIME')}{translate('INDEX.DEST_ADDRESS')}{translate('INDEX.TX_DETAIL')}
    {translate('INDEX.TYPE')}{translate('INDEX.DIRECTION')}{translate('INDEX.CONFIRMATIONS')}{translate('INDEX.AMOUNT')}{translate('INDEX.TIME')}{translate('INDEX.DEST_ADDRESS')}{translate('INDEX.TX_DETAIL')}
    +
    +
    +
    +
    +
    +
    + {translate('INDEX.ZT_BALANCE')} +
    + -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    +
    +
    +

    {translate('INDEX.TRANSACTION_HISTORY')}

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    {translate('INDEX.TYPE')}{translate('INDEX.DIRECTION')}{translate('INDEX.CONFIRMATIONS')}{translate('INDEX.AMOUNT')}{translate('INDEX.TIME')}{translate('INDEX.DEST_ADDRESS')}{translate('INDEX.TX_DETAIL')}
    {translate('INDEX.TYPE')}{translate('INDEX.DIRECTION')}{translate('INDEX.CONFIRMATIONS')}{translate('INDEX.AMOUNT')}{translate('INDEX.TIME')}{translate('INDEX.DEST_ADDRESS')}{translate('INDEX.TX_DETAIL')}
    -

    {translate('INDEX.RECEIVING_ADDRESS')}

    -
    -
    - - - - - - - - - - - - - -
    {translate('INDEX.TYPE')}{translate('INDEX.ADDRESS')}
    {translate('INDEX.TYPE')}{translate('INDEX.ADDRESS')}
    -
    -
    -
    -
    -
    -

    - {translate('INDEX.SEND')} -

    -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - {translate('INDEX.TOTAL')} ( - txfee): 0.000 - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    +
    +
    -
    +
    -

    {translate('INDEX.OPERATIONS_STATUSES')}

    +

    {translate('INDEX.RECEIVING_ADDRESS')}

    - +
    - - - - + + - - - - + +
    {translate('INDEX.STATUS')}ID{translate('INDEX.TIME')}{translate('INDEX.RESULT')}{translate('INDEX.TYPE')}{translate('INDEX.ADDRESS')}
    {translate('INDEX.STATUS')}ID{translate('INDEX.TIME')}{translate('INDEX.RESULT')}{translate('INDEX.TYPE')}{translate('INDEX.ADDRESS')}
    -
    -
    -
    -
    -