diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index 5574c71..30766c2 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -31,8 +31,8 @@ const DashboardRender = function() { { !this.isNativeMode() && } { !this.isNativeMode() && } - { !this.isNativeMode() && } - { !this.isNativeMode() && } + { !this.isNativeMode() && } + { !this.isNativeMode() && } diff --git a/react/src/components/dashboard/receiveCoin/receiveCoin.js b/react/src/components/dashboard/receiveCoin/receiveCoin.js index 475e047..8353e27 100644 --- a/react/src/components/dashboard/receiveCoin/receiveCoin.js +++ b/react/src/components/dashboard/receiveCoin/receiveCoin.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { copyCoinAddress, checkAddressBasilisk, @@ -18,8 +19,8 @@ import { // TODO: fallback to localstorage/stores data in case iguana is taking too long to respond class ReceiveCoin extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { openDropMenu: false, @@ -216,5 +217,18 @@ class ReceiveCoin extends React.Component { return null; } } - -export default ReceiveCoin; +const mapStateToProps = (state) => { + return { + coin: state.ActiveCoin.coin, + mode: state.ActiveCoin.mode, + receive: state.ActiveCoin.receive, + balance: state.ActiveCoin.balance, + cache: state.ActiveCoin.cache, + nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeAddress: state.ActiveCoin.activeAddress, + addresses: state.ActiveCoin.addresses + }; + +}; + +export default connect(mapStateToProps)(ReceiveCoin); \ No newline at end of file diff --git a/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js b/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js index fc6172b..eba514b 100755 --- a/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js +++ b/react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js @@ -1,11 +1,12 @@ import React from 'react'; +import { connect } from 'react-redux'; import { basiliskConnection } from '../../../actions/actionCreators'; import Store from '../../../store'; import WalletsBasiliskConnectionRender from './walletsBasiliskConnection.render'; class WalletsBasiliskConnection extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this); } @@ -33,4 +34,13 @@ class WalletsBasiliskConnection extends React.Component { } } -export default WalletsBasiliskConnection; +const mapStateToProps = (state) => { + return { + Dashboard: { + basiliskConnection: state.Dashboard.basiliskConnection, + connectedNotaries: state.Dashboard.connectedNotaries, + } + }; +}; + +export default connect(mapStateToProps)(WalletsBasiliskConnection); diff --git a/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js b/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js index c55f903..aa60dd7 100644 --- a/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js +++ b/react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import WalletsBasiliskRefreshRender from './walletsBasiliskRefresh.render'; class WalletsBasiliskRefresh extends React.Component { @@ -15,5 +16,11 @@ class WalletsBasiliskRefresh extends React.Component { return null; } } - -export default WalletsBasiliskRefresh; +const mapStateToProps = (state) => { + return { + Dashboard: { + basiliskRefresh: state.Dashboard.basiliskRefresh, + } + }; +}; +export default connect(mapStateToProps)(WalletsBasiliskRefresh); diff --git a/react/src/components/dashboard/walletsCacheData/walletsCacheData.js b/react/src/components/dashboard/walletsCacheData/walletsCacheData.js index df37f08..8296c43 100644 --- a/react/src/components/dashboard/walletsCacheData/walletsCacheData.js +++ b/react/src/components/dashboard/walletsCacheData/walletsCacheData.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { secondsToString } from '../../../util/time'; import { toggleViewCacheModal } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -8,8 +9,8 @@ import WalletsCacheDataRender from './walletsCacheData.render'; // TODO: refresh data render class WalletsCacheData extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.closeViewCacheModal = this.closeViewCacheModal.bind(this); } @@ -183,5 +184,18 @@ class WalletsCacheData extends React.Component { } } } +const mapStateToProps = (state) => { + return { + ActiveCoin: { + mode: state.ActiveCoin.mode, + cache: state.ActiveCoin.cache, + notaries: state.ActiveCoin.notaries, + }, + Dashboard: { + displayViewCacheModal: state.Dashboard.displayViewCacheModal, + } + }; + +}; -export default WalletsCacheData; +export default connect(mapStateToProps)(WalletsCacheData); \ No newline at end of file diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index ffedc92..3809a8f 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { translate } from '../../../translate/translate'; import { sortByDate } from '../../../util/sort'; import { formatValue } from '../../../util/formatValue'; @@ -647,4 +648,34 @@ class WalletsData extends React.Component { } } -export default WalletsData; +const mapStateToProps = (state) => { + return { + ActiveCoin: { + coin: state.ActiveCoin.coin, + mode: state.ActiveCoin.mode, + send: state.ActiveCoin.send, + receive: state.ActiveCoin.receive, + balance: state.ActiveCoin.balance, + cache: state.ActiveCoin.cache, + nativeActiveSection: state.ActiveCoin.nativeActiveSection, + activeAddress: state.ActiveCoin.activeAddress, + lastSendToResponse: state.ActiveCoin.lastSendToResponse, + addresses: state.ActiveCoin.addresses, + txhistory: state.ActiveCoin.txhistory, + showTransactionInfo: state.ActiveCoin.showTransactionInfo, + }, + Dashboard: { + activeHandle: state.Dashboard.activeHandle, + displayViewCacheModal: state.Dashboard.displayViewCacheModal, + basiliskConnection: state.Dashboard.basiliskConnection, + progress: state.Dashboard.progress, + }, + Main: { + coins: state.Main.coins, + } + + }; + +}; + +export default connect(mapStateToProps)(WalletsData); \ No newline at end of file diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 97167ec..6697762 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -144,12 +144,13 @@ export const AddressListRender = function() { }; export const WalletsDataRender = function() { + return ( - - - - + + + +
diff --git a/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js b/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js index 96cc458..3a86e10 100644 --- a/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js +++ b/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { translate } from '../../../translate/translate'; import { displayNotariesModal } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -9,8 +10,8 @@ import { } from './walletsNotariesList.render'; class WalletsNotariesList extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.closeNotariesModal = this.closeNotariesModal.bind(this); } @@ -58,5 +59,15 @@ class WalletsNotariesList extends React.Component { return null; } } +const mapStateToProps = (state) => { + return { + ActiveCoin: { + mode: state.ActiveCoin.mode, + displayNotariesModal: state.ActiveCoin.displayNotariesModal, + notaries: state.ActiveCoin.notaries, + } + }; + +}; -export default WalletsNotariesList; +export default connect(mapStateToProps)(WalletsNotariesList);