mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-25 16:38:08 +00:00
Merge pull request #209 from trezor/fix/topnavigation-indicator
fix for indicator first render
This commit is contained in:
commit
5792a1c03d
@ -6,7 +6,7 @@ import React, { PureComponent } from 'react';
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
pathname: string;
|
pathname: string;
|
||||||
wrapper: ?HTMLElement;
|
wrapper: () => ?HTMLElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
@ -71,8 +71,8 @@ class Indicator extends PureComponent<Props, State> {
|
|||||||
handleResize: () => void;
|
handleResize: () => void;
|
||||||
|
|
||||||
reposition(resetAnimation: boolean = true) {
|
reposition(resetAnimation: boolean = true) {
|
||||||
if (!this.props.wrapper) return;
|
const wrapper = this.props.wrapper();
|
||||||
const { wrapper } = this.props;
|
if (!wrapper) return;
|
||||||
const active = wrapper.querySelector('.active');
|
const active = wrapper.querySelector('.active');
|
||||||
if (!active) return;
|
if (!active) return;
|
||||||
const bounds = active.getBoundingClientRect();
|
const bounds = active.getBoundingClientRect();
|
||||||
|
@ -65,7 +65,7 @@ class TopNavigationAccount extends React.PureComponent<Props> {
|
|||||||
<StyledNavLink to={`${basePath}/receive`}>Receive</StyledNavLink>
|
<StyledNavLink to={`${basePath}/receive`}>Receive</StyledNavLink>
|
||||||
<StyledNavLink to={`${basePath}/send`}>Send</StyledNavLink>
|
<StyledNavLink to={`${basePath}/send`}>Send</StyledNavLink>
|
||||||
{/* <StyledNavLink to={`${basePath}/signverify`}>Sign & Verify</StyledNavLink> */}
|
{/* <StyledNavLink to={`${basePath}/signverify`}>Sign & Verify</StyledNavLink> */}
|
||||||
<Indicator pathname={pathname} wrapper={this.wrapper} />
|
<Indicator pathname={pathname} wrapper={() => this.wrapper} />
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user