commit
3ec7b5c834
|
@ -1,6 +1,7 @@
|
|||
import React, {Component} from 'react';
|
||||
import {Link} from 'react-router';
|
||||
import translate from 'translations';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
|
@ -11,7 +12,8 @@ const tabs = [
|
|||
name: 'NAV_SendEther'
|
||||
},
|
||||
{
|
||||
name: 'NAV_Swap'
|
||||
name: 'NAV_Swap',
|
||||
link: 'swap'
|
||||
},
|
||||
{
|
||||
name: 'NAV_Offline'
|
||||
|
@ -39,6 +41,10 @@ export default class TabsOptions extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
location: PropTypes.object
|
||||
};
|
||||
|
||||
tabClick() {
|
||||
}
|
||||
|
||||
|
@ -49,6 +55,7 @@ export default class TabsOptions extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {location} = this.props;
|
||||
return (
|
||||
<div>
|
||||
<nav role='navigation' aria-label='main navigation' className='container nav-container overflowing'>
|
||||
|
@ -62,7 +69,7 @@ export default class TabsOptions extends Component {
|
|||
{
|
||||
tabs.map((object, i) => {
|
||||
// if the window pathname is the same or similar to the tab objects name, set the active toggle
|
||||
const activeOrNot = (window.location.pathname === object.name || window.location.pathname.substring(1) === object.name) ? 'active' : '';
|
||||
const activeOrNot = (location.pathname === object.link || location.pathname.substring(1) === object.link) ? 'active' : '';
|
||||
return (
|
||||
<li className={`nav-item ${activeOrNot}`}
|
||||
key={i} onClick={this.tabClick(i)}>
|
||||
|
|
|
@ -8,6 +8,8 @@ import { languages, nodeList } from '../../config/data';
|
|||
|
||||
export default class Header extends Component {
|
||||
static propTypes = {
|
||||
location: PropTypes.object,
|
||||
|
||||
// Language DropDown
|
||||
changeLanguage: PropTypes.func,
|
||||
languageSelection: PropTypes.object,
|
||||
|
@ -76,7 +78,7 @@ export default class Header extends Component {
|
|||
</section>
|
||||
</section>
|
||||
|
||||
<TabsOptions {...{}} />
|
||||
<TabsOptions {...this.props} />
|
||||
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -42,9 +42,8 @@ class App extends Component {
|
|||
nodeSelection
|
||||
} = this.props;
|
||||
|
||||
// let title = children.props.route.name;
|
||||
|
||||
let headerProps = {
|
||||
location,
|
||||
changeLanguage,
|
||||
languageSelection,
|
||||
|
||||
|
|
|
@ -33,14 +33,6 @@ export default class GenerateWalletPasswordInputComponent extends Component {
|
|||
className="input-group-addon eye"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/*TODO - if we want descriptive errors we could re-enable this*/}
|
||||
{/*{this.props.meta.touched && this.props.meta.error &&*/}
|
||||
{/*<div>*/}
|
||||
{/*<p className="error">{this.props.meta.error}</p>*/}
|
||||
{/*</div>*/}
|
||||
{/*}*/}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue