improve UX design: click the plugin title to open README (#6286)

* improve UX design: click the plugin title to open readme

* improve UX design: let the icon clickable

* improve UX design: rename the function from open-plugin-readme! to get-open-plugin-readme-handler
This commit is contained in:
lecoan
2022-08-06 21:11:19 +08:00
committed by GitHub
parent 7eef27c020
commit 0c563facad

View File

@@ -261,6 +261,12 @@
(js-invoke js/LSPluginCore (if disabled? "enable" "disable") id))
true)]])
(defn get-open-plugin-readme-handler
[url item repo]
#(plugin-handler/open-readme!
url item (if repo remote-readme-display local-markdown-display))
)
(rum/defc plugin-item-card < rum/static
[t {:keys [id name title version url description author icon iir repo sponsors] :as item}
disabled? market? *search-key has-other-pending?
@@ -278,8 +284,7 @@
:has-new-version new-version}])}
[:div.l.link-block.cursor-pointer
{:on-click #(plugin-handler/open-readme!
url item (if repo remote-readme-display local-markdown-display))}
{:on-click (get-open-plugin-readme-handler url item repo)}
(if (and icon (not (string/blank? icon)))
[:img.icon {:src (if market? (plugin-handler/pkg-asset id icon) icon)}]
svg/folder)
@@ -290,7 +295,9 @@
[:div.r
[:h3.head.text-xl.font-bold.pt-1.5
[:span name]
[:span.l.link-block.cursor-pointer
{:on-click (get-open-plugin-readme-handler url item repo)}
name]
(when (not market?) [:sup.inline-block.px-1.text-xs.opacity-50 version])]
[:div.desc.text-xs.opacity-70