lbry-desktop/src/renderer/component/header/view.jsx

86 lines
2 KiB
React
Raw Normal View History

2018-01-04 06:05:20 +01:00
// @flow
import React from 'react';
2018-01-04 06:05:20 +01:00
import Button from 'component/link';
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) => {
const {
balance,
back,
forward,
isBackDisabled,
isForwardDisabled,
isUpgradeAvailable,
navigate,
downloadUpgrade,
} = 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
onClick={back}
disabled={isBackDisabled}
2018-01-04 06:05:20 +01:00
icon="arrow-left"
description={__('Navigate back')}
/>
2018-01-04 06:05:20 +01:00
<Button
alt
circle
onClick={forward}
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
onClick={() => navigate('/wallet')}
2018-01-04 06:05:20 +01:00
icon="user"
label={isUpgradeAvailable ? `${balance} LBC` : `You have ${balance} LBC`}
title={__('Wallet')}
2017-06-06 23:19:12 +02:00
/>
2018-01-04 06:05:20 +01:00
<Button
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-11-22 21:19:08 +01:00
export default Header;