MyCrypto/common/components/Header/index.jsx

87 lines
3.6 KiB
React
Raw Normal View History

2017-05-23 23:06:01 +00:00
// @flow
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import TabsOptions from './components/TabsOptions';
import { Link } from 'react-router';
2017-06-26 22:27:55 +00:00
import { Dropdown } from 'components/ui';
2017-05-23 23:06:01 +00:00
import { languages, nodeList } from '../../config/data';
2017-04-12 05:04:27 +00:00
export default class Header extends Component {
static propTypes = {
2017-06-18 19:56:12 +00:00
location: PropTypes.object,
2017-05-23 23:06:01 +00:00
// Language DropDown
changeLanguage: PropTypes.func,
2017-05-23 23:06:01 +00:00
languageSelection: PropTypes.object,
2017-04-18 23:36:29 +00:00
2017-05-23 23:06:01 +00:00
// Node Dropdown
changeNode: PropTypes.func,
2017-05-23 23:06:01 +00:00
nodeSelection: PropTypes.object
2017-04-12 05:04:27 +00:00
};
render() {
2017-05-23 23:06:01 +00:00
const { languageSelection, changeLanguage, changeNode, nodeSelection } = this.props;
2017-04-12 05:04:27 +00:00
return (
2017-04-18 23:36:29 +00:00
<div>
<section className="bg-gradient header-branding">
<section className="container">
2017-04-27 06:15:57 +00:00
<Link to={'/'} className="brand" aria-label="Go to homepage">
2017-04-18 23:36:29 +00:00
{/* TODO - don't hardcode image path*/}
<img
2017-05-23 23:06:01 +00:00
src={'https://www.myetherwallet.com/images/logo-myetherwallet.svg'}
2017-04-27 06:15:57 +00:00
height="64px"
2017-04-18 23:36:29 +00:00
width="245px"
2017-05-23 23:06:01 +00:00
alt="MyEtherWallet"
/>
2017-04-27 06:15:57 +00:00
</Link>
2017-04-18 23:36:29 +00:00
<div className="tagline">
2017-05-23 23:06:01 +00:00
<span style={{ maxWidth: '395px' }}>
Open-Source & Client-Side Ether Wallet · v3.6.0
</span>
2017-04-18 23:36:29 +00:00
&nbsp;&nbsp;&nbsp;
2017-05-23 23:06:01 +00:00
<Dropdown
ariaLabel={`change language. current language ${languageSelection.name}`}
options={languages}
formatTitle={o => o.name}
value={languageSelection}
extra={[
<li key={'separator'} role="separator" className="divider" />,
<li key={'disclaimer'}>
<a data-toggle="modal" data-target="#disclaimerModal">
Disclaimer
</a>
</li>
]}
onChange={changeLanguage}
/>
2017-04-18 23:36:29 +00:00
&nbsp;&nbsp;&nbsp;
2017-05-23 23:06:01 +00:00
<Dropdown
ariaLabel={`change node. current node ${nodeSelection.name} node by ${nodeSelection.service}`}
options={nodeList}
formatTitle={o => [
o.name,
' ',
<small key="service">({o.service})</small>
]}
value={nodeSelection}
extra={
<li>
<a onClick={() => {}}>
Add Custom Node
</a>
</li>
}
onChange={changeNode}
/>
2017-04-18 23:36:29 +00:00
</div>
</section>
2017-04-12 05:04:27 +00:00
</section>
2017-04-18 23:36:29 +00:00
2017-06-18 19:56:12 +00:00
<TabsOptions {...this.props} />
2017-04-18 23:36:29 +00:00
</div>
2017-05-23 23:06:01 +00:00
);
2017-04-12 05:04:27 +00:00
}
}