import React from 'react' import uiStores from 'stores/ui' // import JengaExtra from '../extra/JengaExtra' import JengaItem from './JengaItem' const minWidth = 858 // 最小宽度 export default class JengaPanel extends React.Component { constructor(props) { super(props) this.jengaContent = React.createRef() this.onUiChange = this.onUiChange.bind(this) this.setWidth = this.setWidth.bind(this) } componentDidMount() { this.setWidth(uiStores.jengaViewWidthDelta) this.unsubscribe = uiStores.listen(this.onUiChange) } componentWillUnmount() { this.unsubscribe() } onUiChange(status) { if (status && status.types) { if (status.types.includes('changeJengaViewWidthDelta')) { this.setWidth(status.data.jengaViewWidthDelta) } } } setWidth(delta) { if (this.jengaContent && this.jengaContent.current) { this.jengaContent.current.style.width = minWidth + delta + 'px' } } render() { return (