|
|
@ -163,21 +163,18 @@ type State = {
|
|
|
|
animationType: ?string,
|
|
|
|
animationType: ?string,
|
|
|
|
clicked: boolean,
|
|
|
|
clicked: boolean,
|
|
|
|
bodyMinHeight: number,
|
|
|
|
bodyMinHeight: number,
|
|
|
|
bodyHeight: number,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LeftNavigation extends React.PureComponent<Props, State> {
|
|
|
|
class LeftNavigation extends React.PureComponent<Props, State> {
|
|
|
|
constructor(props: Props) {
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.deviceMenuRef = React.createRef();
|
|
|
|
this.deviceMenuRef = React.createRef();
|
|
|
|
this.leftMenuBodyRef = React.createRef();
|
|
|
|
|
|
|
|
const { location } = this.props.router;
|
|
|
|
const { location } = this.props.router;
|
|
|
|
const hasNetwork = location && location.state && location.state.network;
|
|
|
|
const hasNetwork = location && location.state && location.state.network;
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
animationType: hasNetwork ? 'slide-left' : null,
|
|
|
|
animationType: hasNetwork ? 'slide-left' : null,
|
|
|
|
clicked: false,
|
|
|
|
clicked: false,
|
|
|
|
bodyMinHeight: 0,
|
|
|
|
bodyMinHeight: 0,
|
|
|
|
bodyHeight: 0,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -234,17 +231,10 @@ class LeftNavigation extends React.PureComponent<Props, State> {
|
|
|
|
bodyMinHeight: this.deviceMenuRef.current.getMenuHeight(),
|
|
|
|
bodyMinHeight: this.deviceMenuRef.current.getMenuHeight(),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.leftMenuBodyRef.current) {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
bodyHeight: this.leftMenuBodyRef.current.getBoundingClientRect().height,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deviceMenuRef: { current: any };
|
|
|
|
deviceMenuRef: { current: any };
|
|
|
|
|
|
|
|
|
|
|
|
leftMenuBodyRef: { current: any };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { props } = this;
|
|
|
|
const { props } = this;
|
|
|
|
let menu;
|
|
|
|
let menu;
|
|
|
@ -376,14 +366,8 @@ class LeftNavigation extends React.PureComponent<Props, State> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{...this.props}
|
|
|
|
{...this.props}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Body ref={this.leftMenuBodyRef} minHeight={this.state.bodyMinHeight}>
|
|
|
|
<Body minHeight={this.state.bodyMinHeight}>
|
|
|
|
{dropdownOpened && (
|
|
|
|
{dropdownOpened && <DeviceMenu ref={this.deviceMenuRef} {...this.props} />}
|
|
|
|
<DeviceMenu
|
|
|
|
|
|
|
|
ref={this.deviceMenuRef}
|
|
|
|
|
|
|
|
overlayHeight={this.state.bodyHeight}
|
|
|
|
|
|
|
|
{...this.props}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
{isDeviceAccessible && menu}
|
|
|
|
{isDeviceAccessible && menu}
|
|
|
|
</Body>
|
|
|
|
</Body>
|
|
|
|
<Footer data-test="Main__page__footer" key="sticky-footer">
|
|
|
|
<Footer data-test="Main__page__footer" key="sticky-footer">
|
|
|
|