mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-22 05:51:18 +00:00
fix missing indicator on account change
This commit is contained in:
parent
4e11e3ee0d
commit
e116cb17cd
@ -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>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user