2018-01-04 06:05:20 +01:00
|
|
|
// @flow
|
2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
2018-01-04 06:05:20 +01:00
|
|
|
import Button from 'component/link';
|
2017-12-21 22:08:54 +01:00
|
|
|
import WunderBar from 'component/wunderbar';
|
2017-05-04 05:44:08 +02:00
|
|
|
|
2018-01-04 06:05:20 +01:00
|
|
|
type Props = {
|
|
|
|
balance: string,
|
|
|
|
back: any => void,
|
|
|
|
forward: any => void,
|
|
|
|
isBackDisabled: boolean,
|
|
|
|
isForwardDisabled: boolean,
|
|
|
|
isUpgradeAvailable: boolean,
|
|
|
|
navigate: any => void,
|
|
|
|
downloadUpgrade: any => void,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Header = (props: Props) => {
|
2017-08-16 01:29:55 +02:00
|
|
|
const {
|
|
|
|
balance,
|
|
|
|
back,
|
|
|
|
forward,
|
|
|
|
isBackDisabled,
|
|
|
|
isForwardDisabled,
|
2017-11-15 02:51:06 +01:00
|
|
|
isUpgradeAvailable,
|
2017-08-16 01:29:55 +02:00
|
|
|
navigate,
|
2017-11-15 02:51:06 +01:00
|
|
|
downloadUpgrade,
|
2017-08-16 01:29:55 +02:00
|
|
|
} = props;
|
2017-06-06 23:19:12 +02:00
|
|
|
return (
|
|
|
|
<header id="header">
|
2018-01-04 06:05:20 +01:00
|
|
|
<div className="header__actions-left">
|
|
|
|
<Button
|
|
|
|
alt
|
|
|
|
circle
|
2017-08-08 06:10:42 +02:00
|
|
|
onClick={back}
|
2017-08-16 01:29:55 +02:00
|
|
|
disabled={isBackDisabled}
|
2018-01-04 06:05:20 +01:00
|
|
|
icon="arrow-left"
|
|
|
|
description={__('Navigate back')}
|
2017-08-08 06:10:42 +02:00
|
|
|
/>
|
2018-01-04 06:05:20 +01:00
|
|
|
|
|
|
|
<Button
|
|
|
|
alt
|
|
|
|
circle
|
2017-08-08 06:10:42 +02:00
|
|
|
onClick={forward}
|
2017-08-16 01:29:55 +02:00
|
|
|
disabled={isForwardDisabled}
|
2018-01-04 06:05:20 +01:00
|
|
|
icon="arrow-right"
|
|
|
|
description={__('Navigate forward')}
|
2017-06-06 23:19:12 +02:00
|
|
|
/>
|
2018-01-04 06:05:20 +01:00
|
|
|
|
|
|
|
<Button alt onClick={() => navigate('/discover')} icon="home" description={__('Home')} />
|
2017-06-06 23:19:12 +02:00
|
|
|
</div>
|
2018-01-04 06:05:20 +01:00
|
|
|
|
|
|
|
<WunderBar />
|
|
|
|
|
|
|
|
<div className="header__actions-right">
|
|
|
|
<Button
|
|
|
|
inverse
|
2017-12-21 22:08:54 +01:00
|
|
|
onClick={() => navigate('/wallet')}
|
2018-01-04 06:05:20 +01:00
|
|
|
icon="user"
|
|
|
|
label={isUpgradeAvailable ? `${balance} LBC` : `You have ${balance} LBC`}
|
2017-12-21 22:08:54 +01:00
|
|
|
title={__('Wallet')}
|
2017-06-06 23:19:12 +02:00
|
|
|
/>
|
2018-01-04 06:05:20 +01:00
|
|
|
|
|
|
|
<Button
|
2017-12-21 22:08:54 +01:00
|
|
|
onClick={() => navigate('/publish')}
|
2018-01-04 06:05:20 +01:00
|
|
|
icon="cloud-upload"
|
|
|
|
label={isUpgradeAvailable ? '' : __('Publish')}
|
2017-06-06 23:19:12 +02:00
|
|
|
/>
|
2018-01-04 06:05:20 +01:00
|
|
|
|
|
|
|
<Button alt onClick={() => navigate('/settings')} icon="gear" title={__('Settings')} />
|
|
|
|
|
|
|
|
<Button alt onClick={() => navigate('/help')} icon="question" title={__('Help')} />
|
|
|
|
{isUpgradeAvailable && (
|
|
|
|
<Button
|
|
|
|
onClick={() => downloadUpgrade()}
|
|
|
|
icon="arrow-up"
|
|
|
|
label={__('Upgrade App')}
|
|
|
|
title={__('Upgrade app')}
|
|
|
|
/>
|
|
|
|
)}
|
2017-06-06 23:19:12 +02:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
);
|
2017-06-06 06:21:55 +02:00
|
|
|
};
|
2016-08-27 16:12:56 +02:00
|
|
|
|
2016-11-22 21:19:08 +01:00
|
|
|
export default Header;
|