weaver_trunk_cli/pc4mobx/esearch/public/wea-zmage/components/Background/index.js

28 lines
580 B
JavaScript

/**
* 背景层
* 叠加半透明背景
**/
// React Libs
import React from 'react'
// Style
import './index.less'
export default class Background extends React.Component {
constructor(props) {
super(props)
}
bgOverlayStyle = show => show ? {backgroundColor: 'rgba(0,0,0,1)'} : {backgroundColor: 'rgba(0,0,0,0)'}
render() {
const {show, zoom, unmountSelf, toggleZoom} = this.props
return (
<div
className="backgroundLayer"
onClick={zoom ? toggleZoom : unmountSelf}
style={this.bgOverlayStyle(show)}
/>
)
}
}