From 3877c76175007ddf0659abd63f30c7d163650174 Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 17 Jan 2017 13:52:46 +0100 Subject: Show book count --- src/main/scala/reading/component/index/Books.scala | 7 +++++-- src/main/scala/reading/component/index/style/Books.scala | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/scala/reading/component/index/Books.scala b/src/main/scala/reading/component/index/Books.scala index 3faa130..4e42823 100644 --- a/src/main/scala/reading/component/index/Books.scala +++ b/src/main/scala/reading/component/index/Books.scala @@ -14,11 +14,14 @@ object Books { def apply(books: Rx[Seq[Book]]): Frag = div( BooksStyle.render, - BooksStyle.books, RxTag { implicit context => div( - BooksStyle.books, + div( + BooksStyle.count, + s"${books().length} livres" + ), + books().sorted.map { book => div( BooksStyle.book, diff --git a/src/main/scala/reading/component/index/style/Books.scala b/src/main/scala/reading/component/index/style/Books.scala index ad7375d..9e118d8 100644 --- a/src/main/scala/reading/component/index/style/Books.scala +++ b/src/main/scala/reading/component/index/style/Books.scala @@ -7,7 +7,8 @@ import reading.component.style.Col object Books extends StyleSheet.Inline { import dsl._ - val books = style( + val count = style( + marginBottom(30.px) ) val book = style( -- cgit v1.2.3