Skip to content

Commit

Permalink
Rendering authors properly
Browse files Browse the repository at this point in the history
  • Loading branch information
bpruvost committed Jun 11, 2020
1 parent 9efd47a commit 5f88d18
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Binary file modified images/my-library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/components/Book.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ class Book extends Component {
onShelfChange: PropTypes.func.isRequired,
};

getAuthors = (authors) => {
if (authors) {
return authors.join(', ')
}
return ''
}

render() {
const { book, onShelfChange } = this.props;

Expand Down Expand Up @@ -38,7 +45,7 @@ class Book extends Component {
</div>
</div>
<div className="book-title">{book.title}</div>
<div className="book-authors">{book.authors}</div>
<div className="book-authors">{this.getAuthors(book.authors)}</div>
</div>
);
}
Expand Down

0 comments on commit 5f88d18

Please sign in to comment.