1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-15 21:08:57 +00:00

fix for indicator first render

This commit is contained in:
Szymon Lesisz 2018-10-22 10:07:00 +02:00
parent dca466ed8a
commit 16f830ff9d
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ import React, { PureComponent } from 'react';
type Props = {
pathname: string;
wrapper: ?HTMLElement;
wrapper: () => ?HTMLElement;
}
type State = {
@ -71,8 +71,8 @@ class Indicator extends PureComponent<Props, State> {
handleResize: () => void;
reposition(resetAnimation: boolean = true) {
if (!this.props.wrapper) return;
const { wrapper } = this.props;
const wrapper = this.props.wrapper();
if (!wrapper) return;
const active = wrapper.querySelector('.active');
if (!active) return;
const bounds = active.getBoundingClientRect();

View File

@ -65,7 +65,7 @@ class TopNavigationAccount extends React.PureComponent<Props> {
<StyledNavLink to={`${basePath}/receive`}>Receive</StyledNavLink>
<StyledNavLink to={`${basePath}/send`}>Send</StyledNavLink>
{/* <StyledNavLink to={`${basePath}/signverify`}>Sign & Verify</StyledNavLink> */}
<Indicator pathname={pathname} wrapper={this.wrapper} />
<Indicator pathname={pathname} wrapper={() => this.wrapper} />
</Wrapper>
);
}