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