Skip to content

Instantly share code, notes, and snippets.

@aerze
Created July 29, 2016 19:10
Show Gist options
  • Save aerze/168dd4074d56555fc73904dbed777354 to your computer and use it in GitHub Desktop.
Save aerze/168dd4074d56555fc73904dbed777354 to your computer and use it in GitHub Desktop.
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