king
2022-10-08 2ccd33975abf91f9a7929ca8ed6fc03d74ee424d
src/menu/components/share/normalheader/index.jsx
@@ -22,10 +22,6 @@
    appType: sessionStorage.getItem('appType')
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props.config), fromJS(nextProps.config))
  }
@@ -37,15 +33,14 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
  }
  getStyle = (comIds, style) => {
    const { config } = this.props
  getStyle = (style) => {
    if (!style.borderBottomWidth) {
      style.borderBottomWidth = '0px'
    }
    if (comIds[0] !== config.uuid || comIds[1] !== 'header') return
    let _config = {...config, headerStyle: style}
    let _config = {...this.props.config, headerStyle: style}
    
    this.props.updateComponent(_config)
  }
@@ -58,19 +53,19 @@
      options.push('padding')
    }
    MKEmitter.emit('changeStyle', [config.uuid, 'header'], options, config.headerStyle)
    MKEmitter.emit('changeStyle', options, config.headerStyle, this.getStyle)
  }
  render() {
    const { config, hideSearch } = this.props
    const { appType } = this.state
    // const { appType } = this.state
    let title = config.plot ? config.plot.title : config.wrap.title
    let show = true
    if (!title && appType === 'mob' && config.type === 'card' && config.subtype === 'datacard' && config.action && config.action.length) {
      title = ' '
    }
    // if (!title && appType === 'mob' && config.type === 'card' && config.subtype === 'datacard' && config.action && config.action.length) {
    //   title = ' '
    // }
    if (!title && (!config.search || config.search.length === 0 || hideSearch === 'true')) {
      show = false