Last active
November 5, 2016 23:44
-
-
Save Breta01/10f3a009aab78c9816ff960752fd1416 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import React from 'react'; | |
// Gamecard based on MDL Cards | |
const Gamecard = React.createClass({ | |
render: function() { | |
// JS object containing CSS like syntax | |
// We can use other variables in it (e.g. props) | |
const CardImage = { | |
height: '175px', | |
background: 'url("' + this.props.image + '") center / cover' | |
}; | |
return ( | |
<div className="gcard mdl-card"> | |
{/* Passing the JS object with CSS to the style attribute */} | |
<div className="mdl-card__title" style={ CardTitle }> | |
<h2 className="mdl-card__title-text">{ this.props.title }</h2> | |
</div> | |
<div className="mdl-card__supporting-text"> | |
{ this.props.description } | |
</div> | |
<div className="mdl-card__actions mdl-card--border"> | |
<a className="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect"> | |
START | |
</a> | |
</div> | |
</div> | |
); | |
} | |
}); | |
export default Gamecard; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment