From 1d49767da9d4591d6f1110d876710d8499da858a Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Wed, 22 Feb 2017 11:31:38 +0200 Subject: [PATCH] Repositories view improvements * show personal repos group before other groups * CSS tweaks --- src/cljs/commiteth/repos.cljs | 19 +++++++++++-------- src/less/style.less | 4 ++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/cljs/commiteth/repos.cljs b/src/cljs/commiteth/repos.cljs index 4cce32b..1636421 100644 --- a/src/cljs/commiteth/repos.cljs +++ b/src/cljs/commiteth/repos.cljs @@ -38,15 +38,18 @@ (defn repos-list [] (let [repos (rf/subscribe [:repos]) - user (rf/subscribe [:user]) - repo-groups (keys @repos)] + user (rf/subscribe [:user])] (fn [] - (into [:div] - (for [[group group-repos] - (map (fn [group] [group (get @repos group)]) repo-groups)] - [:div [repo-group-title group (:login @user)] - (into [:div.ui.cards] - (map repo-card group-repos))]))))) + (let [repo-groups (sort-by identity (fn [a _] (= a (:login @user))) + (keys @repos))] + (println repo-groups) + (into [:div] + (for [[group group-repos] + (map (fn [group] [group (get @repos group)]) + repo-groups)] + [:div.repo-group-title [repo-group-title group (:login @user)] + (into [:div.ui.cards] + (map repo-card group-repos))])))))) (defn repos-page [] diff --git a/src/less/style.less b/src/less/style.less index e33d866..22a326a 100644 --- a/src/less/style.less +++ b/src/less/style.less @@ -149,6 +149,10 @@ span.dropdown.icon { } } +.repo-group-title { + margin-bottom: 1.5em; +} + .repo-label { color: #1bb5c1; font-family: 'postgrotesk-medium';