index.js 681 B

1234567891011121314151617
  1. import React from 'react';
  2. import './index.less';
  3. import { Icon } from 'antd';
  4. import Assets from '@src/components/Assets';
  5. function QrCode(props) {
  6. const { className = '', qrCode, width, height, vague = false, refresh = false, onRefresh } = props;
  7. return (
  8. <div className={`qr-code-item ${className}`}>
  9. {!vague && qrCode && <Assets width={width} height={height} src={qrCode} />}
  10. {vague && <Assets width={width} height={height} name='' />}
  11. {refresh && <div style={{ lineHeight: `${height}px` }} className='fixed-refresh' onClick={() => onRefresh && onRefresh()}><Icon type="sync" /></div>}
  12. </div>
  13. );
  14. }
  15. QrCode.propTypes = {};
  16. export default QrCode;