Skip to content

Commit

Permalink
update react example app
Browse files Browse the repository at this point in the history
  • Loading branch information
15Dkatz committed Feb 14, 2017
1 parent 3131ab3 commit dc9a491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions course_material/lectures/react/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class App extends Component {
.then(response => response.json())
.then(json => {
console.log('book items', json);
let items = json.items;
let { items } = json;
this.setState({items});
})
}
Expand All @@ -33,7 +33,6 @@ class App extends Component {
<FormControl
type="text"
placeholder="Search for a Book"
value={this.state.query}
onChange={event => {this.setState({query: event.target.value})}}
onKeyPress={event => {
if (event.key == "Enter") {
Expand Down
9 changes: 4 additions & 5 deletions course_material/lectures/react/components/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class Gallery extends Component {
<div>
{
this.props.items.map((item, index) => {
let { title, subtitle, imageLinks, infoLink } = item.volumeInfo;
let { thumbnail } = imageLinks;
let { title, imageLinks, infoLink } = item.volumeInfo;
return (
<a
key={index}
Expand All @@ -16,13 +15,13 @@ class Gallery extends Component {
target="_blank"
>
<img
src={thumbnail}
src={imageLinks.thumbnail}
className="book-img"
alt="book"
/>
<p className="book-text">
<div className="book-text">
{title}
</p>
</div>
</a>
)
})
Expand Down

0 comments on commit dc9a491

Please sign in to comment.