UNPKG

@aimake/nanod

Version:

## 设计模式 NANO DESIGN 是面向于企业级中台化应用的解决方案。服务于 ToB 和 ToE 类型的单页应用,应用于各产品中从而产出了一套设计及前端规范。

51 lines (42 loc) 1.37 kB
import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _createClass from 'babel-runtime/helpers/createClass'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import React, { Component } from 'react'; import PropTypes from 'prop-types'; var Logo = function (_Component) { _inherits(Logo, _Component); function Logo() { _classCallCheck(this, Logo); return _possibleConstructorReturn(this, (Logo.__proto__ || _Object$getPrototypeOf(Logo)).apply(this, arguments)); } _createClass(Logo, [{ key: 'render', value: function render() { var _props = this.props, logo = _props.logo, title = _props.title; return React.createElement( 'div', { className: 'nano-logo' }, logo && logo.length > 0 ? React.createElement('img', { src: logo, alt: 'logo' }) : null, React.createElement( 'h1', null, title ) ); } }]); return Logo; }(Component); Logo.propTypes = { logo: PropTypes.string, title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]) }; Logo.defaultProps = { logo: undefined, title: undefined }; export default Logo;