Skip to content
Snippets Groups Projects
Commit 18797da1 authored by john's avatar john
Browse files

handle empty book list

parent e9613587
No related branches found
No related tags found
No related merge requests found
import { map, reverse, sortBy } from 'lodash'
import { isEmpty, map, reverse, sortBy } from 'lodash'
import React from 'react'
import Book from './Book'
import styles from './dashboard.local.scss'
class BookList extends React.Component {
renderBookList () {
const { books, container, remove } = this.props
if (!books) return 'Fetching...'
if (isEmpty(books)) {
return (
<div className={styles['booklist-empty']}>
There are no books to display.
</div>
)
}
const items = reverse(sortBy(books, 'created'))
const bookComponents = map(items, book => {
......
......@@ -88,4 +88,8 @@ $medium-grey: #838587;
text-decoration: none;
}
}
.booklist-empty {
padding-top: 15px;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment