2017-06-06 17:19:12 -04:00
|
|
|
import React from "react";
|
2017-08-25 16:26:09 -04:00
|
|
|
import { formatCredits } from "util/formatCredits";
|
2017-06-06 17:19:12 -04:00
|
|
|
import { connect } from "react-redux";
|
2017-08-30 08:48:32 -04:00
|
|
|
import {
|
|
|
|
selectIsBackDisabled,
|
|
|
|
selectIsForwardDisabled,
|
|
|
|
} from "selectors/navigation";
|
2017-06-06 17:19:12 -04:00
|
|
|
import { selectBalance } from "selectors/wallet";
|
2017-08-30 08:48:32 -04:00
|
|
|
import {
|
|
|
|
doNavigate,
|
|
|
|
doHistoryBack,
|
|
|
|
doHistoryForward,
|
|
|
|
} from "actions/navigation";
|
2017-06-06 17:19:12 -04:00
|
|
|
import Header from "./view";
|
2017-04-22 20:17:01 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
const select = state => ({
|
2017-08-15 19:29:55 -04:00
|
|
|
isBackDisabled: selectIsBackDisabled(state),
|
|
|
|
isForwardDisabled: selectIsForwardDisabled(state),
|
2017-09-06 15:05:35 -04:00
|
|
|
balance: formatCredits(selectBalance(state) || 0, 1),
|
2017-05-28 16:09:56 +02:00
|
|
|
publish: __("Publish"),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-04-22 20:17:01 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
const perform = dispatch => ({
|
2017-06-06 17:19:12 -04:00
|
|
|
navigate: path => dispatch(doNavigate(path)),
|
2017-05-03 23:44:08 -04:00
|
|
|
back: () => dispatch(doHistoryBack()),
|
2017-08-07 22:10:42 -06:00
|
|
|
forward: () => dispatch(doHistoryForward()),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-04-22 20:17:01 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
export default connect(select, perform)(Header);
|