UNPKG

react-app-shell

Version:

react打包脚本和example, 这里的版本请忽略

34 lines (29 loc) 1.01 kB
import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import styles from './index.less'; import arrows from '../../public/images/common/share-arrows.png'; import gesture from '../../public/images/common/share-gesture.png'; class ShareMask extends PureComponent { static propTypes = { visible: PropTypes.bool, onCancel: PropTypes.func, }; static defaultProps = { visible: true, }; handleCancel = () => { let {onCancel} = this.props; onCancel && onCancel(); }; render() { let {visible} = this.props; return visible ? ( <div className={styles['share-content']} onClick={this.handleCancel}> <img className={styles['img-errow']} alt="" src={arrows}/> <img className={styles['img-hand']} alt="" src={gesture}/> <p>点击右上角分享给好友或分享到朋友圈~</p> </div> ) : null; } } export default ShareMask;