2017-09-03 18:35:01 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
2017-11-13 22:02:23 +01:00
|
|
|
import { makeSelectBlockDate } from "redux/selectors/wallet";
|
|
|
|
import { doFetchBlock } from "redux/actions/wallet";
|
2017-09-03 18:35:01 +02:00
|
|
|
import DateTime from "./view";
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2017-11-21 20:51:12 +01:00
|
|
|
date:
|
|
|
|
!props.date && props.block
|
|
|
|
? makeSelectBlockDate(props.block)(state)
|
|
|
|
: props.date,
|
2017-09-03 18:35:01 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
fetchBlock: height => dispatch(doFetchBlock(height)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(DateTime);
|