diff --git a/src/cljs/commiteth/core.cljs b/src/cljs/commiteth/core.cljs index 328dfe9..b6f44dd 100644 --- a/src/cljs/commiteth/core.cljs +++ b/src/cljs/commiteth/core.cljs @@ -133,10 +133,10 @@ [:div.ui.container [:div.ui.grid.stackable [:div.ten.wide.computer.sixteen.wide.tablet.column - [:div.ui.container.page-content + [:div.ui.container [(pages @(rf/subscribe [:page]))]]] [:div.six.wide.column.computer.only - [:div.ui.container.page-content + [:div.ui.container [:h3 "Top hunters"] [top-hunters]]]] [:div.ui.divider]]]])) diff --git a/src/cljs/commiteth/handlers.cljs b/src/cljs/commiteth/handlers.cljs index b1153a8..5381971 100644 --- a/src/cljs/commiteth/handlers.cljs +++ b/src/cljs/commiteth/handlers.cljs @@ -132,12 +132,15 @@ :dispatch-n [[:load-user-repos] [:load-owner-bounties]]})) +(reg-event-db + :clear-repos-loading + (fn [db [_]] + (assoc db :repos-loading? false))) + (reg-event-db :set-user-repos (fn [db [_ repos]] - (-> db - (assoc :repos repos) - (assoc :repos-loading? false)))) + (assoc db :repos repos))) (reg-event-fx :load-user-repos @@ -145,7 +148,10 @@ {:db (assoc db :repos-loading? true) :http {:method GET :url "/api/user/repositories" - :on-success #(dispatch [:set-user-repos (:repositories %)])}})) + :on-success #(dispatch [:set-user-repos (:repositories %)]) + :on-error #(dispatch [:set-flash-message + :error "Failed to load repositories"]) + :finally #(dispatch [:clear-repos-loading])}})) (defn update-repo-state [all-repos full-name data] diff --git a/src/cljs/commiteth/repos.cljs b/src/cljs/commiteth/repos.cljs index 1636421..cb91e42 100644 --- a/src/cljs/commiteth/repos.cljs +++ b/src/cljs/commiteth/repos.cljs @@ -42,7 +42,6 @@ (fn [] (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)]) @@ -57,6 +56,6 @@ (fn [] (if @repos-loading? [:div - [:div.ui.active.dimmer - [:div.ui.loader]]] + [:div.ui.active.inverted.dimmer + [:div.ui.text.loader "Loading"]]] [repos-list])))) diff --git a/src/less/style.less b/src/less/style.less index 22a326a..efceebe 100644 --- a/src/less/style.less +++ b/src/less/style.less @@ -149,6 +149,10 @@ span.dropdown.icon { } } +.ui.grid { + margin-top: 0px; +} + .repo-group-title { margin-bottom: 1.5em; } @@ -183,12 +187,6 @@ span.dropdown.icon { } } - -.page-content { - margin-top: 2em; -} - - .ui.button.repo-added-button { color: white; background-color: #61deb0;