Created
February 26, 2016 12:44
-
-
Save rahmanusta/77edeee2fd5f02e7c8bf to your computer and use it in GitHub Desktop.
jumbotron React Component
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 Jumbotron = React.createClass({ | |
render: function () { | |
return (<div className="jumbotron"> | |
<h1>{this.props.title || "Hello, world"}!</h1> | |
<p>{this.props.content || "No content"}</p> | |
<p> | |
<a className="btn btn-primary btn-lg" href={this.props.link} role="button"> | |
{this.props.more || "Learn more"} | |
</a> | |
</p> | |
</div>); | |
} | |
}); | |
var lorem = `Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab aspernatur assumenda consectetur corporis deleniti dolores | |
illum impedit ipsa iure, magni odit optio perferendis, perspiciatis sapiente sed temporibus unde vitae voluptatibus!`; | |
var settings = { | |
title: "Merhaba Dünya", | |
content: lorem, | |
more: "Dahası", | |
link: "http://kodcu.com" | |
}; | |
var root = document.querySelector("#placeholder"); | |
ReactDOM.render(<Jumbotron {...settings} />, root); | |
/* | |
ReactDOM.render(<Jumbotron title="Merhaba Dünya" | |
content={lorem} | |
more="Dahası" | |
link="http://kodcu.com" />, root); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment