enhance: use home icon instead of our logo for the mac desktop app

pull/2391/head
Tienson Qin 2021-07-07 01:49:54 +08:00
parent 0812847216
commit dd53195e92
4 changed files with 21 additions and 9 deletions

View File

@ -26,16 +26,18 @@
[frontend.handler.migrate :as migrate])) [frontend.handler.migrate :as migrate]))
(rum/defc logo < rum/reactive (rum/defc logo < rum/reactive
[{:keys [white?]}] [{:keys [white? electron-mac?]}]
[:a.cp__header-logo [:a.cp__header-logo
{:href (rfe/href :home) {:href (rfe/href :home)
:on-click (fn [] :on-click (fn []
(util/scroll-to-top) (util/scroll-to-top)
(state/set-journals-length! 2))} (state/set-journals-length! 2))}
(if-let [logo (and config/publishing? (if electron-mac?
(get-in (state/get-config) [:project :logo]))] svg/home
[:img.cp__header-logo-img {:src logo}] (if-let [logo (and config/publishing?
(svg/logo (not white?)))]) (get-in (state/get-config) [:project :logo]))]
[:img.cp__header-logo-img {:src logo}]
(svg/logo (not white?))))])
(rum/defc login (rum/defc login
[logged?] [logged?]
@ -185,7 +187,8 @@
[:div.flex-1]) [:div.flex-1])
(when electron-mac? (when electron-mac?
(logo {:white? white?})) (logo {:white? white?
:electron-mac? true}))
(new-block-mode) (new-block-mode)

View File

@ -70,7 +70,6 @@
@apply p-2; @apply p-2;
} }
.cp__header-logo,
.cp__right-menu-button { .cp__right-menu-button {
opacity: 0.3; opacity: 0.3;
} }
@ -103,6 +102,10 @@
} }
} }
.cp__header-logo svg {
transform: scale(0.9);
}
#repo-name { #repo-name {
@apply md:max-w-none; @apply md:max-w-none;
vertical-align: middle; vertical-align: middle;

View File

@ -578,3 +578,6 @@
:stroke-width "2" :stroke-width "2"
:stroke-linejoin "round" :stroke-linejoin "round"
:stroke-linecap "round"}]]) :stroke-linecap "round"}]])
(def home
[:svg.h-6.w-6 {:fill "none" :viewbox "0 0 24 24" :stroke "currentColor"} [:path {:stroke-linecap "round" :stroke-linejoin "round" :stroke-width "2" :d "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"}]])

View File

@ -7482,12 +7482,15 @@ react-grid-layout@^0.16.6:
react-draggable "3.x" react-draggable "3.x"
react-resizable "1.x" react-resizable "1.x"
react-icon-base@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/react-icon-base/-/react-icon-base-2.1.0.tgz#a196e33fdf1e7aaa1fda3aefbb68bdad9e82a79d"
integrity sha1-oZbjP98eeqof2jrvu2i9rZ6Cp50=
react-icons@^2.2.7: react-icons@^2.2.7:
version "2.2.7" version "2.2.7"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-2.2.7.tgz#d7860826b258557510dac10680abea5ca23cf650" resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-2.2.7.tgz#d7860826b258557510dac10680abea5ca23cf650"
integrity sha512-0n4lcGqzJFcIQLoQytLdJCE0DKSA9dkwEZRYoGrIDJZFvIT6Hbajx5mv9geqhqFiNjUgtxg8kPyDfjlhymbGFg== integrity sha512-0n4lcGqzJFcIQLoQytLdJCE0DKSA9dkwEZRYoGrIDJZFvIT6Hbajx5mv9geqhqFiNjUgtxg8kPyDfjlhymbGFg==
dependencies:
react-icon-base "2.1.0"
react-is@^16.3.1, react-is@^16.8.1: react-is@^16.3.1, react-is@^16.8.1:
version "16.13.1" version "16.13.1"