From 7d74e024bbdfe8ac20e9dc89d4368ea80db5b7f5 Mon Sep 17 00:00:00 2001 From: defclass Date: Mon, 28 Dec 2020 14:28:50 +0800 Subject: [PATCH] fix(Login): fix login style --- src/main/frontend/components/header.cljs | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main/frontend/components/header.cljs b/src/main/frontend/components/header.cljs index 7975e28b5a..b3087db216 100644 --- a/src/main/frontend/components/header.cljs +++ b/src/main/frontend/components/header.cljs @@ -155,21 +155,23 @@ (when (and (not logged?) (not config/publishing?)) - [:a.text-sm.font-medium.login.opacity-70.hover:opacity-100 - {:href "/login/github" - :on-click (fn [] - (storage/remove :git/current-repo))} - (t :login-github)] - ) - - (when (and (not logged?) - (not config/publishing?)) - [:a.text-sm.font-medium.login.opacity-70.hover:opacity-100 - {:href "/login/google" - :on-click (fn [] - (storage/remove :git/current-repo))} - (t :login-google)]) + (ui/dropdown-with-links + (fn [{:keys [toggle-fn]}] + [:a {:on-click toggle-fn} + [:span.ml-1 "Login"] + [:span.ml-1 {:style {:border-top-color "#6b7280"}}]]) + (let [list [{:title (t :login-github) + :url "/login/github"} + {:title (t :login-google) + :url "/login/google"}]] + (mapv + (fn [{:keys [title url]}] + {:title title + :options + {:on-click + (fn [_] (set! (.-href js/window.location) url))}}) + list)))) (repo/sync-status)