Skip to content

Commit

Permalink
Merge pull request #45 from dannibaxter/productsHomeReact
Browse files Browse the repository at this point in the history
added placeholder image if image is not provided by DJ when creating …
  • Loading branch information
knxyzkn authored Jan 29, 2017
2 parents 3901454 + 2ae60fe commit 7fde9c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/ProductsHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ProductsHome extends React.Component {
return(
<div>
<h1>Welcome to DJKM!</h1>
<strong>Hire a DJ</strong>
<strong><p>Hire a DJ (or <a href="/addProduct">Become a DJ</a>)</p></strong>
<div className="well well-sm">
<SearchFilter />
</div>
Expand All @@ -53,7 +53,7 @@ class ProductsHome extends React.Component {
onClick={()=>this.props.selectProduct(curr)}
to={`/products/${curr.id}`}
>
<img src={curr.image} />
<img src={curr.image==='' ? '/default.png' : curr.image} />
</Link>

<div className="caption">
Expand Down
1 change: 1 addition & 0 deletions app/containers/CreateProductContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default connect(

handleSubmit(e) {
e.preventDefault();
console.log(this.state.newProduct);
axios.post('/api/products', this.state.newProduct)
.then((response) => {
// console.log(response);
Expand Down
Binary file added public/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7fde9c6

Please sign in to comment.