king
2022-08-19 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9
src/pc/components/navbar/normal-navbar/index.jsx
@@ -63,10 +63,6 @@
    }
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
@@ -78,7 +74,6 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
  }
  
  /**
@@ -94,17 +89,18 @@
    this.props.updateConfig(component)
  }
  getStyle = (comIds, style) => {
    const { card } = this.state
  getStyle = (style) => {
    let _card = {...this.state.card, style}
    if (comIds[0] !== card.uuid) return
    this.setState({
      card: _card
    })
    this.props.updateConfig(_card)
  }
    let _card = {...card}
    if (comIds.length === 1) {
      _card = {...card, style}
    } else if (comIds[1] === 'logo') {
      _card = {...card, logoStyle: style}
    }
  getLogoStyle = (style) => {
    let _card = {...this.state.card, logoStyle: style}
    this.setState({
      card: _card
@@ -116,13 +112,13 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', [card.uuid], ['font', 'background', 'shadow'], card.style)
    MKEmitter.emit('changeStyle', ['font', 'background', 'shadow'], card.style, this.getStyle)
  }
  changeLogoStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', [card.uuid, 'logo'], ['width', 'margin'], card.logoStyle)
    MKEmitter.emit('changeStyle', ['width', 'margin'], card.logoStyle, this.getLogoStyle)
  }
  clickComponent = (e) => {