mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 09:18:09 +00:00
fix for LeftNavigation render
- removed componentDidMount which resets state applied in contructor - added animationType in constructor if location has network
This commit is contained in:
parent
ca2842b6ae
commit
bfea1b225c
@ -69,7 +69,7 @@ type TransitionMenuProps = {
|
|||||||
children?: React.Node;
|
children?: React.Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TransitionMenu needs to dispatch window.resize even
|
// TransitionMenu needs to dispatch window.resize event
|
||||||
// in order to StickyContainer be recalculated
|
// in order to StickyContainer be recalculated
|
||||||
const TransitionMenu = (props: TransitionMenuProps): React$Element<TransitionGroup> => (
|
const TransitionMenu = (props: TransitionMenuProps): React$Element<TransitionGroup> => (
|
||||||
<TransitionGroupWrapper component="div" className="transition-container">
|
<TransitionGroupWrapper component="div" className="transition-container">
|
||||||
@ -98,19 +98,14 @@ type State = {
|
|||||||
class LeftNavigation extends React.PureComponent<Props, State> {
|
class LeftNavigation extends React.PureComponent<Props, State> {
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
const { location } = this.props.router;
|
||||||
|
const hasNetwork = location && location.state && location.state.network;
|
||||||
this.state = {
|
this.state = {
|
||||||
animationType: null,
|
animationType: hasNetwork ? 'slide-left' : null,
|
||||||
shouldRenderDeviceSelection: false,
|
shouldRenderDeviceSelection: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
this.setState({
|
|
||||||
animationType: null,
|
|
||||||
shouldRenderDeviceSelection: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps: Props) {
|
componentWillReceiveProps(nextProps: Props) {
|
||||||
const { deviceDropdownOpened } = nextProps;
|
const { deviceDropdownOpened } = nextProps;
|
||||||
const { selectedDevice } = nextProps.wallet;
|
const { selectedDevice } = nextProps.wallet;
|
||||||
|
Loading…
Reference in New Issue
Block a user