|
|
|
@ -14,6 +14,9 @@ type Props = {
|
|
|
|
|
router: $ElementType<State, 'router'>,
|
|
|
|
|
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
|
|
|
|
};
|
|
|
|
|
type StateProps = {
|
|
|
|
|
wrapper: ?HTMLElement,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Wrapper = styled.div`
|
|
|
|
|
position: relative;
|
|
|
|
@ -66,10 +69,18 @@ const StyledNavLink = styled(NavLink)`
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
class TopNavigationAccount extends React.PureComponent<Props> {
|
|
|
|
|
class TopNavigationAccount extends React.PureComponent<Props, StateProps> {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
wrapper: null,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wrapperRefCallback = (element: ?HTMLElement) => {
|
|
|
|
|
this.wrapper = element;
|
|
|
|
|
this.forceUpdate();
|
|
|
|
|
this.setState({
|
|
|
|
|
wrapper: element,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wrapper: ?HTMLElement;
|
|
|
|
@ -90,7 +101,7 @@ class TopNavigationAccount extends React.PureComponent<Props> {
|
|
|
|
|
{network.type === 'ethereum'
|
|
|
|
|
&& <StyledNavLink to={`${basePath}/signverify`}>Sign & Verify</StyledNavLink>
|
|
|
|
|
}
|
|
|
|
|
<Indicator pathname={pathname} wrapper={() => this.wrapper} />
|
|
|
|
|
<Indicator pathname={pathname} wrapper={() => this.state.wrapper} />
|
|
|
|
|
</Wrapper>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|