/* @flow */ 'use strict'; import React, { Component } from 'react'; import { NavLink } from 'react-router-dom'; type State = { style: any; } class Indicator extends Component { state: State; constructor(props: any) { super(props); this.state = { style: { width: 0, left: 0 }, } this.reposition = this.reposition.bind(this); } handleResize() { this.reposition(); } componentDidMount() { this.reposition(); window.addEventListener('resize', this.reposition, false); } componentWillUnmount() { window.removeEventListener('resize', this.reposition, false); } componentDidUpdate(newProps: any) { this.reposition(); } reposition() { const tabs = document.querySelector('.account-tabs'); const active = tabs.querySelector('.active'); const bounds = active.getBoundingClientRect(); const left = bounds.left - tabs.getBoundingClientRect().left; if (this.state.style.left !== left) { this.setState({ style: { width: bounds.width, left: left, } }) } } render() { return (
{ this.props.pathname }
); } } const AccountTabs = (props: any): any => { const urlParams = props.match.params; //const urlParams = props.match ? props.match.params : { address: '0' }; const basePath = `/device/${urlParams.device}/coin/${urlParams.coin}/address/${urlParams.address}`; return (
{/* History */} Summary Send Receive {/* Sign & Verify */}
); } export default AccountTabs;