Created
May 15, 2017 20:07
-
-
Save sasafister/d13dd3b027b5681bf8f70284e6a22465 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
import React, { Component } from 'react' | |
class Card extends Component { | |
constructor(props) { | |
super(props) | |
this.state = {price: ''} | |
this.handleChange = this.handleChange.bind(this) | |
} | |
handleChange(event) { | |
this.setState({ price: event.target.value}) | |
} | |
render() { | |
const lesson = this.props.lesson | |
if(lesson.description === undefined) { | |
return <div></div> | |
} | |
return ( | |
<div className="card row col-md-12"> | |
<img src={lesson.imageurl} className="col-md-3" /> | |
<div className="col-md-6"> | |
<div className="card-title">{lesson.productname}</div> | |
<p>{lesson.description.short}</p> | |
</div> | |
<div className="pull-right col-md-3"> | |
<div className="input-group"> | |
<input type="text" name="discount_price" value={this.state.price} className="form-control" onChange={this.handleChange} /> | |
</div> | |
<s><strong>{lesson.price._} {lesson.price.$.currency}</strong></s> | |
</div> | |
</div> | |
) | |
} | |
} | |
export default Card |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment