Skip to content

Commit

Permalink
Changes to savedDealsComp jsx DealListComp jsx and Deal jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
afriedman1991 committed Jan 5, 2018
1 parent fe68bf2 commit ff90a2f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
18 changes: 13 additions & 5 deletions src/Deal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ import React from 'react';

const Deal = (props) => (
<div>
{props.deal.title} | {props.deal.price} | {props.deal.url}
<div className="card" style={{"float": "left", "width": "25rem", "height": "30rem", "margin": "10px"}}>
<img className="card-img-top" src={props.deal.imgUrl} alt="Card image cap"></img>
<div className="card-block">
<h4 className="card-title">{props.deal.merchant}</h4>
<p className="card-text">{props.deal.title}</p>
<ul className="list-group list-group-flush">
<li className="list-group-item">Original Price: ${props.deal.price}</li>
<li className="list-group-item">Discount Percent: {props.deal.discount}</li>
</ul>
<a href={props.deal.url} className="btn btn-primary" style={{"position": "absolute", "bottom": "0px"}}>Deal Link</a>
</div>
</div>
</div>
)

//Need to change the image so that it is just a thumbnail and not such a large image


export default Deal;
export default Deal;
2 changes: 1 addition & 1 deletion src/DealListComp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import Coupon from './Deal.js';

const DealListComp = (props) => (
<div>
<div className="container">
<h2>Here's {props.deals.length} deals that you're head over heels for!</h2>
{props.deals.map((deal, idx) => <Coupon deal={deal} key={deal.id} />)}
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/SavedDealsComp.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ class SavedDealsComp extends React.Component {

render() {
return (
<div>
<h1>Saved Deals!</h1>
<div className="container">
<div style={{"left": "50px"}}>
<h1>Saved Deals!</h1>
</div>
<DealList deals={this.state.savedDeals}/>
</div>
)
Expand Down

0 comments on commit ff90a2f

Please sign in to comment.