Redux #115

Merged
6ea86b96 merged 57 commits from redux into redux 2017-05-05 22:55:12 +02:00
3 changed files with 44 additions and 24 deletions
Showing only changes of commit 823a936c19 - Show all commits

View file

@ -7,6 +7,7 @@ import {
} from 'actions/app'
import {
doGetNewAddress,
doCheckAddressIsMine,
} from 'actions/wallet'
import {
selectCurrentPage,
@ -34,6 +35,7 @@ const select = (state) => ({
const perform = (dispatch) => ({
closeModal: () => dispatch(doCloseModal()),
getNewAddress: () => dispatch(doGetNewAddress()),
checkAddressIsMine: (address) => dispatch(doCheckAddressIsMine(address))
})
export default connect(select, perform)(WalletPage)

View file

@ -12,12 +12,17 @@ import {
CreditAmount
} from 'component/common';
const AddressSection = (props) => {
class AddressSection extends React.Component {
componentWillMount() {
this.props.checkAddressIsMine(this.props.receiveAddress)
}
render() {
const {
receiveAddress,
getNewAddress,
gettingNewAddress,
} = props
} = this.props
return (
<section className="card">
@ -39,6 +44,7 @@ const AddressSection = (props) => {
</section>
);
}
}
var SendToAddressSection = React.createClass({
handleSubmit: function(event) {

View file

@ -45,6 +45,18 @@ reducers[types.UPDATE_BALANCE] = function(state, action) {
})
}
reducers[types.CHECK_ADDRESS_IS_MINE_STARTED] = function(state, action) {
return Object.assign({}, state, {
checkingAddressOwnership: true
})
}
reducers[types.CHECK_ADDRESS_IS_MINE_COMPLETED] = function(state, action) {
return Object.assign({}, state, {
checkingAddressOwnership: false
})
}
export default function reducer(state = defaultState, action) {
const handler = reducers[action.type];
if (handler) return handler(state, action);