UNPKG

standard-resume

Version:
47 lines (39 loc) 955 B
'use strict'; var React = require('react'); var Logo = React.createClass({ displayName: 'Logo', propTypes: { firstName: React.PropTypes.string.isRequired, lastName: React.PropTypes.string.isRequired, style: React.PropTypes.string, color: React.PropTypes.string }, getDefaultProps: function getDefaultProps() { return { style: 'resume' }; }, render: function render() { var firstInitial = this.props.firstName.slice(0, 1); var lastInitial = this.props.lastName.slice(0, 1); var style = {}; if (this.props.color) { style.backgroundColor = this.props.color; } return React.createElement( 'div', { className: 'c-main-logo ' + this.props.style, style: style }, React.createElement( 'div', null, firstInitial ), React.createElement( 'div', null, lastInitial ) ); } }); module.exports = Logo;