king
2020-06-28 48a18736c461ad730bd264b0ac7b40b68a0e33a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React, {Component} from 'react'
// import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Collapse } from 'antd'
 
import zhCN from '@/locales/zh-CN/mob.js'
import enUS from '@/locales/en-US/mob.js'
import './index.scss'
 
const { Panel } = Collapse
 
class MobController extends Component {
  // static propTpyes = {
  //   collapse: PropTypes.bool,
  // }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
  }
 
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
 
  render () {
 
    return (
      <div className="mob-controller">
        <Collapse expandIconPosition="right">
          <Panel header="字体" key="0">
            字体修改
          </Panel>
          <Panel header="背景" key="1">
            背景
          </Panel>
          <Panel header="边距" key="2">
            边距
          </Panel>
          <Panel header="其他" key="3">
            其他
          </Panel>
        </Collapse>
      </div>
    )
  }
}
 
export default MobController