import React, { PureComponent } from 'react'; import Link from 'umi/link'; import RightContent from '../GlobalHeader/RightContent'; import BaseMenu from '../SiderMenu/BaseMenu'; import styles from './index.less'; export default class TopNavHeader extends PureComponent { constructor(props) { super(props); this.state = { maxWidth: (props.grid === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, }; } static getDerivedStateFromProps(props) { return { maxWidth: (props.grid === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, }; } render() { const { theme, grid, logo } = this.props; const { maxWidth } = this.state; return (