// @flow import * as ICONS from 'constants/icons'; import * as SETTINGS from 'constants/settings'; import * as React from 'react'; import { withRouter } from 'react-router'; import Button from 'component/button'; import LbcSymbol from 'component/common/lbc-symbol'; import WunderBar from 'component/wunderbar'; import Icon from 'component/common/icon'; import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button'; type Props = { autoUpdateDownloaded: boolean, balance: string, isUpgradeAvailable: boolean, roundedBalance: number, downloadUpgradeRequested: any => void, history: { push: string => void, goBack: () => void, goForward: () => void }, currentTheme: string, automaticDarkModeEnabled: boolean, setClientSetting: (string, boolean | string) => void, }; const Header = (props: Props) => { const { roundedBalance, history, setClientSetting, currentTheme, automaticDarkModeEnabled } = props; function handleThemeToggle() { if (automaticDarkModeEnabled) { setClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED, false); } if (currentTheme === 'dark') { setClientSetting(SETTINGS.THEME, 'light'); } else { setClientSetting(SETTINGS.THEME, 'dark'); } } return (
{/* @endif */}
{roundedBalance > 0 ? ( {roundedBalance} ) : ( __('Account') )} history.push(`/$/account`)}> {__('Overview')} history.push(`/$/wallet`)}> {__('Wallet')} history.push(`/$/publish`)}> {__('Publish')} history.push(`/$/settings`)}> {__('Settings')} history.push(`/$/help`)}> {__('Help')} {currentTheme === 'light' ? 'Dark' : 'Light'}
); }; export default withRouter(Header);