mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-16 05:19:12 +00:00
Merge pull request #374 from trezor/fix/top-menu-indicator
Fix/top menu indicator
This commit is contained in:
commit
3829f6e67f
@ -14,6 +14,9 @@ type Props = {
|
||||
router: $ElementType<State, 'router'>,
|
||||
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||
};
|
||||
type LocalState = {
|
||||
wrapper: ?HTMLElement,
|
||||
};
|
||||
|
||||
const Wrapper = styled.div`
|
||||
position: relative;
|
||||
@ -66,9 +69,18 @@ const StyledNavLink = styled(NavLink)`
|
||||
}
|
||||
`;
|
||||
|
||||
class TopNavigationAccount extends React.PureComponent<Props> {
|
||||
class TopNavigationAccount extends React.PureComponent<Props, LocalState> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
wrapper: null,
|
||||
};
|
||||
}
|
||||
|
||||
wrapperRefCallback = (element: ?HTMLElement) => {
|
||||
this.wrapper = element;
|
||||
this.setState({
|
||||
wrapper: element,
|
||||
});
|
||||
}
|
||||
|
||||
wrapper: ?HTMLElement;
|
||||
@ -89,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>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user