Merge pull request #220 from status-im/feature/pagination-#156

Correct 'Showing' label text
This commit is contained in:
Teemu Patja 2018-01-16 17:52:35 +02:00 committed by GitHub
commit d3338d3eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -2,6 +2,7 @@
(:require [re-frame.core :as rf]
[commiteth.common :refer [moment-timestamp
display-data-page
items-per-page
issue-url]]))
@ -43,14 +44,18 @@
[:div.ui.tiny.circular.image
[:img {:src avatar-url}]]]]))
(defn bounties-list [{:keys [items item-count total-count] :as bounty-page-data}]
(defn bounties-list [{:keys [items item-count page-number total-count]
:as bounty-page-data}]
[:div.ui.container.open-bounties-container
[:div.open-bounties-header "Bounties"]
(if (empty? items)
[:div.view-no-data-container
[:p "No recent activity yet"]]
[:div [:div.item-counts-label
[:span (str "Showing " item-count " of " total-count)]]
[:div
(let [left (inc (* (dec page-number) items-per-page))
right (dec (+ left item-count))]
[:div.item-counts-label
[:span (str "Showing " left "-" right " of " total-count)]])
(display-data-page bounty-page-data bounty-item :set-bounty-page-number)])])
(defn bounties-page []

View File

@ -30,7 +30,7 @@
(defn issue-url [owner repo number]
(str "https://github.com/" owner "/" repo "/issues/" number))
(def items-per-page 20)
(def items-per-page 15)
(defn draw-page-numbers [page-number page-count set-page-kw]
"Draw page numbers for the pagination component.