index.js 641 B

1234567891011121314151617181920
  1. import React from 'react';
  2. import { Icon } from 'antd';
  3. import './index.less';
  4. import Assets from '../Assets';
  5. function Logo(props) {
  6. const { src, className, color, backgroundColor, icon, size = 50 } = props;
  7. return (
  8. <div className={`logo-wrapper ${className}`} style={{ width: size, height: size, lineHeight: `${size}px` }}>
  9. {src ? (
  10. <Assets src={src} />
  11. ) : (
  12. <div style={{ background: backgroundColor, lineHeight: `${size * 1.1}px` }} className="logo-item">
  13. {icon && <Icon style={{ color, fontSize: size / 2 }} type={icon} />}
  14. </div>
  15. )}
  16. </div>
  17. );
  18. }
  19. export default Logo;