"Top hunters" UI

* front end support for "top hunters"
* placeholder data used for now
This commit is contained in:
Teemu Patja 2017-02-19 19:52:22 +02:00
parent 7ce1dc6cdc
commit b8facb1a97
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
5 changed files with 95 additions and 43 deletions

View File

@ -129,14 +129,37 @@
:bounties #'bounties-page
:update-address #'update-address-page})
(defn top-hunters []
(let [top-hunters (rf/subscribe [:top-hunters])]
(fn []
(into [:div.ui.items.top-hunters]
(map-indexed (fn [idx hunter]
[:div.item
[:div.leader-ordinal (str (+ 1 idx))]
[:div.ui..mini.circular.image
[:img {:src (:profile-image-url hunter)}]]
[:div.content
[:div.header (:display-name hunter)]
[:div.description (str "ETH " (:eth-earned hunter))]]])
@top-hunters)))))
(defn page []
(fn []
[:div.ui.pusher
[page-header]
;; [error-pane]
[:div.ui.vertical.segment
[:div.page-content
[(pages @(rf/subscribe [:page]))]]]]))
[:div.ui.container
[:div.ui.grid.stackable
[:div.twelve.wide.column
[:div.ui.container.page-content
[(pages @(rf/subscribe [:page]))]]]
[:div.four.wide.column.computer.only
[:div.ui.container.page-content
[:h3 "Top hunters"]
[top-hunters]]]]]]]))
(secretary/set-config! :prefix "#")

View File

@ -10,4 +10,10 @@
:error nil
:pagination {}
:pagination-props {:page-size 10
:pages-max 10}})
:pages-max 10}
:top-hunters [{:profile-image-url "https://randomuser.me/api/portraits/men/4.jpg"
:display-name "Place Holder"
:eth-earned "11 000.00"}
{:profile-image-url "https://randomuser.me/api/portraits/men/6.jpg"
:display-name "Dummy User"
:eth-earned "8 400.00"}]})

View File

@ -41,7 +41,7 @@
user (rf/subscribe [:user])
repo-groups (keys @repos)]
(fn []
(into [:div.ui.container]
(into [:div]
(for [[group group-repos]
(map (fn [group] [group (get @repos group)]) repo-groups)]
[:div [repo-group-title group (:login @user)]
@ -53,8 +53,7 @@
(let [repos-loading? (rf/subscribe [:repos-loading?])]
(fn []
(if @repos-loading?
[:div.ui.container
[:p]
[:div
[:div.ui.active.dimmer
[:div.ui.loader]]]
[repos-list]))))

View File

@ -41,6 +41,11 @@
(fn [db [_ table]]
(get-in db [:pagination table])))
(reg-sub
:top-hunters
(fn [db _]
(:top-hunters db)))
(reg-sub
:get-in
(fn [db [_ path]]

View File

@ -33,6 +33,25 @@
opacity: 0.98;
}
.top-hunters {
.header {
color: #474951!important;
font-size: 1.1em!important;
opacity: .98!important;
}
.description {
color: #a8aab1!important;
}
.leader-ordinal {
font-size: 1.5em;
float: none;
margin-top: 8px;
margin-right: 15px;
color: #a8aab1;
opacity: .45;
}
}
.ui.mini.circular.image {
height: 35px;
}