Add App upgrade button to the header

This commit is contained in:
Igor Gassmann 2017-11-09 21:07:02 -03:00
parent c219cf9709
commit feb19bdea9
2 changed files with 18 additions and 0 deletions

View file

@ -11,6 +11,7 @@ import {
doHistoryBack, doHistoryBack,
doHistoryForward, doHistoryForward,
} from "actions/navigation"; } from "actions/navigation";
import { doDownloadUpgrade } from "actions/app";
import Header from "./view"; import Header from "./view";
const select = state => ({ const select = state => ({
@ -18,12 +19,15 @@ const select = state => ({
isForwardDisabled: selectIsForwardDisabled(state), isForwardDisabled: selectIsForwardDisabled(state),
balance: formatCredits(selectBalance(state) || 0, 1), balance: formatCredits(selectBalance(state) || 0, 1),
publish: __("Publish"), publish: __("Publish"),
upgrade: __("Upgrade"),
upgradeSkipped: true,
}); });
const perform = dispatch => ({ const perform = dispatch => ({
navigate: path => dispatch(doNavigate(path)), navigate: path => dispatch(doNavigate(path)),
back: () => dispatch(doHistoryBack()), back: () => dispatch(doHistoryBack()),
forward: () => dispatch(doHistoryForward()), forward: () => dispatch(doHistoryForward()),
downloadUpgrade: () => dispatch(doDownloadUpgrade()),
}); });
export default connect(select, perform)(Header); export default connect(select, perform)(Header);

View file

@ -6,11 +6,14 @@ export const Header = props => {
const { const {
balance, balance,
back, back,
downloadUpgrade,
forward, forward,
isBackDisabled, isBackDisabled,
isForwardDisabled, isForwardDisabled,
navigate, navigate,
publish, publish,
upgradeLabel,
upgradeSkipped,
} = props; } = props;
return ( return (
<header id="header"> <header id="header">
@ -77,6 +80,17 @@ export const Header = props => {
title={__("Settings")} title={__("Settings")}
/> />
</div> </div>
<rem>HEY I'M HER E</rem>
{upgradeSkipped
? <div className="header__item">
<Link
onClick={() => downloadUpgrade()}
button="primary button--flat"
icon="icon-upload"
label={upgradeLabel}
/>
</div>
: ""}
</header> </header>
); );
}; };