Created
July 29, 2016 19:10
-
-
Save aerze/168dd4074d56555fc73904dbed777354 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Headings = React.createClass({ | |
propTypes: { | |
h1: React.PropTypes.string.isRequired, | |
h2: React.PropTypes.string, | |
name: React.PropTypes.string | |
}, | |
render: function render() { | |
var h1 = (this.props.name) ? this.props.name + ', ' + h1 : h1; | |
var h2 = this.props.h2 || ''; | |
return ( | |
<div className="wrap" name={this.user.first_name || 'Congratulations'}> | |
<h1 className="headline">{h1}</h1> | |
<h2 className="subheadline"> {h2}</h2> | |
</div> | |
); | |
} | |
}); | |
module.exports = Headings; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment