Add App upgrade button to the header
This commit is contained in:
parent
c219cf9709
commit
feb19bdea9
2 changed files with 18 additions and 0 deletions
|
@ -11,6 +11,7 @@ import {
|
|||
doHistoryBack,
|
||||
doHistoryForward,
|
||||
} from "actions/navigation";
|
||||
import { doDownloadUpgrade } from "actions/app";
|
||||
import Header from "./view";
|
||||
|
||||
const select = state => ({
|
||||
|
@ -18,12 +19,15 @@ const select = state => ({
|
|||
isForwardDisabled: selectIsForwardDisabled(state),
|
||||
balance: formatCredits(selectBalance(state) || 0, 1),
|
||||
publish: __("Publish"),
|
||||
upgrade: __("Upgrade"),
|
||||
upgradeSkipped: true,
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
navigate: path => dispatch(doNavigate(path)),
|
||||
back: () => dispatch(doHistoryBack()),
|
||||
forward: () => dispatch(doHistoryForward()),
|
||||
downloadUpgrade: () => dispatch(doDownloadUpgrade()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(Header);
|
||||
|
|
|
@ -6,11 +6,14 @@ export const Header = props => {
|
|||
const {
|
||||
balance,
|
||||
back,
|
||||
downloadUpgrade,
|
||||
forward,
|
||||
isBackDisabled,
|
||||
isForwardDisabled,
|
||||
navigate,
|
||||
publish,
|
||||
upgradeLabel,
|
||||
upgradeSkipped,
|
||||
} = props;
|
||||
return (
|
||||
<header id="header">
|
||||
|
@ -77,6 +80,17 @@ export const Header = props => {
|
|||
title={__("Settings")}
|
||||
/>
|
||||
</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>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue