lbry-desktop/ui/js/page/wallet/index.js

54 lines
1.6 KiB
JavaScript
Raw Normal View History

2017-04-22 15:17:01 +02:00
import React from 'react'
import {
connect
} from 'react-redux'
import {
doCloseModal,
} from 'actions/app'
import {
doGetNewAddress,
2017-04-22 16:01:57 +02:00
doCheckAddressIsMine,
2017-04-23 07:55:47 +02:00
doSendDraftTransaction,
doSetDraftTransactionAmount,
doSetDraftTransactionAddress,
2017-04-22 15:17:01 +02:00
} from 'actions/wallet'
import {
selectCurrentPage,
selectCurrentModal,
2017-04-22 15:17:01 +02:00
} from 'selectors/app'
import {
selectBalance,
selectTransactions,
selectTransactionItems,
selectIsFetchingTransactions,
selectReceiveAddress,
selectGettingNewAddress,
2017-04-23 07:55:47 +02:00
selectDraftTransactionAmount,
selectDraftTransactionAddress,
2017-04-22 15:17:01 +02:00
} from 'selectors/wallet'
import WalletPage from './view'
const select = (state) => ({
currentPage: selectCurrentPage(state),
balance: selectBalance(state),
transactions: selectTransactions(state),
fetchingTransactions: selectIsFetchingTransactions(state),
transactionItems: selectTransactionItems(state),
receiveAddress: selectReceiveAddress(state),
gettingNewAddress: selectGettingNewAddress(state),
modal: selectCurrentModal(state),
2017-04-23 07:55:47 +02:00
address: selectDraftTransactionAddress(state),
amount: selectDraftTransactionAmount(state),
2017-04-22 15:17:01 +02:00
})
const perform = (dispatch) => ({
closeModal: () => dispatch(doCloseModal()),
getNewAddress: () => dispatch(doGetNewAddress()),
checkAddressIsMine: (address) => dispatch(doCheckAddressIsMine(address)),
2017-04-23 07:55:47 +02:00
sendToAddress: () => dispatch(doSendDraftTransaction()),
setAmount: (event) => dispatch(doSetDraftTransactionAmount(event.target.value)),
setAddress: (event) => dispatch(doSetDraftTransactionAddress(event.target.value)),
2017-04-22 15:17:01 +02:00
})
export default connect(select, perform)(WalletPage)