This commit is contained in:
kagel 2016-08-23 15:22:38 +03:00
parent 58a66236e7
commit b4eb921361
2 changed files with 10 additions and 4 deletions

View File

@ -35,3 +35,10 @@ html, body {
padding-right: 1em; padding-right: 1em;
color: rgba(0,0,0,.3); color: rgba(0,0,0,.3);
} }
.navbar-toggler, .nav-item {
float: left;
display: inline-block;
padding-left: 10px;
padding-right: 10px;
}

View File

@ -21,13 +21,13 @@
{:href uri {:href uri
:on-click #(reset! collapsed? true)} title]]))) :on-click #(reset! collapsed? true)} title]])))
(defn login-link [] (defn login-link [collapsed?]
(let [user (rf/subscribe [:user])] (let [user (rf/subscribe [:user])]
(fn [] (fn []
(if-let [login (:login @user)] (if-let [login (:login @user)]
[:li.pull-right.p [:li.pull-right.p
[:span.profile-link "Logged in as " [:span.profile-link "Logged in as "
[:a {:href "/#/profile"} login]] [:a {:href "/#/profile" :on-click #(reset! collapsed? true)} login]]
[:a.btn.btn-primary.btn-sm {:href "/logout"} "Logout"]] [:a.btn.btn-primary.btn-sm {:href "/logout"} "Logout"]]
[:li.pull-right [:li.pull-right
[:a.btn.btn-social.btn-github [:a.btn.btn-social.btn-github
@ -43,10 +43,9 @@
{:on-click #(swap! collapsed? not)} "☰"] {:on-click #(swap! collapsed? not)} "☰"]
[:div.collapse.navbar-toggleable-xs [:div.collapse.navbar-toggleable-xs
(when-not @collapsed? {:class "in"}) (when-not @collapsed? {:class "in"})
[:a.navbar-brand {:href "#/"} "commiteth"]
[:ul.nav.navbar-nav [:ul.nav.navbar-nav
[nav-link "#/" "Home" :home collapsed?] [nav-link "#/" "Home" :home collapsed?]
[login-link]]]]))) [login-link collapsed?]]]])))
(defn home-page [] (defn home-page []
(fn [] (fn []