Browse Source

enhance: marketplace polish

Tienson Qin 4 years ago
parent
commit
6ab7f44f5f

+ 29 - 38
src/main/frontend/components/plugins.cljs

@@ -68,7 +68,7 @@
                               (state/set-modal! nil))}
               [:section
                [:strong.block (when plg (str (:name plg) " / ")) (:name opt)]
-               [:small.opacity-30.italic (:description opt)]]
+               [:small.opacity-50.italic (:description opt)]]
               [:small.flex-shrink-0.flex.items-center.opacity-10
                (if current-selected (svg/check 28))]]))
          themes)])))
@@ -164,9 +164,9 @@
         [:h3.head.text-xl.font-bold.pt-1.5
 
          [:span name]
-         (if (not market?) [:sup.inline-block.px-1.text-xs.opacity-30 version])]
+         (if (not market?) [:sup.inline-block.px-1.text-xs.opacity-50 version])]
 
-        [:div.desc.text-xs.opacity-60
+        [:div.desc.text-xs.opacity-70
          [:p description]
          ;;[:small (js/JSON.stringify (bean/->js settings))]
          ]
@@ -310,48 +310,39 @@
        [:div.mb-4.flex.items-center.justify-between
 
         [:div.flex.align-items
-         (ui/button
-           (t :plugin/load-unpacked)
-           :title (t :plugin/unpacked-tips)
-           :intent "logseq"
-           :on-click plugin-handler/load-unpacked-plugin)
-
-         (ui/button
-           [:span.flex.items-center
-            [:i {:style {:transform "scale(.8)"}} svg/external-link] "Samples for Developer"]
-           :class "ml-2"
-           :intent "logseq"
-           :on-click #(plugin-handler/invoke-exported-api
-                        "open_external_link" "https://github.com/logseq/logseq-plugin-samples"))
+         (ui/tippy {:html [:div (t :plugin/unpacked-tips)]
+                    :arrow true}
+          (ui/button
+            (t :plugin/load-unpacked)
+            :intent "logseq"
+            :on-click plugin-handler/load-unpacked-plugin))
 
          (unpacked-plugin-loader selected-unpacked-pkg)]
 
         (when (util/electron?)
           [:div.flex.align-items
+           ;; (ui/button
+           ;;   (t :plugin/open-preferences)
+           ;;   :intent "logseq"
+           ;;   :on-click (fn []
+           ;;               (p/let [root (plugin-handler/get-ls-dotdir-root)]
+           ;;                 (js/apis.openPath (str root "/preferences.json")))))
            (ui/button
-             (t :plugin/open-preferences)
+             (t :plugin/contribute)
+             :href "https://github.com/logseq/marketplace"
              :intent "logseq"
-             :on-click (fn []
-                         (p/let [root (plugin-handler/get-ls-dotdir-root)]
-                           (js/apis.openPath (str root "/preferences.json")))))
-
-           (ui/button
-             [:span.flex.items-center
-              [:span.pr-1
-               (ui/Tippy
-                 {:html     [:small.inline-flex.py-2.pr-2
-                             {:style {:max-width "180px" :text-align "left" :justify-content "flex-start"}}
-                             (t :plugin/marketplace-tips)]
-                  :arrow    true
-                  :distance 18
-                  :offset   -25
-                  :theme    "transparent"}
-                 (svg/info))]
-
-              (t :plugin/restart)]
-             :class "ml-2"
-             :intent "logseq"
-             :on-click #(plugin-handler/invoke-exported-api "relaunch"))])]
+             :target "_blank")
+
+           (ui/tippy
+            {:html     [:small.inline-flex.py-2.pr-2
+                        {:style {:max-width "180px" :text-align "left" :justify-content "flex-start"}}
+                        (t :plugin/marketplace-tips)]
+             :arrow    true
+             :distance 18
+             :offset   -25
+             :interactive true
+             :theme    "transparent"}
+            (svg/info))])]
 
        [:div.cp__plugins-item-lists.grid-cols-1.md:grid-cols-2.lg:grid-cols-3
         (for [[_ item] installed-plugins]

+ 2 - 2
src/main/frontend/components/plugins.css

@@ -78,7 +78,7 @@
 
       > p {
         color: var(--ls-primary-text-color);
-        opacity: .5;
+        opacity: .8;
 
         > small:last-child {
           cursor: pointer;
@@ -352,4 +352,4 @@ body[data-page=plugins] {
     padding-left: 30px;
     padding-right: 30px;
   }
-}
+}

+ 3 - 2
src/main/frontend/dicts.cljs

@@ -326,8 +326,9 @@
         :plugin/load-unpacked "Load unpacked plugin"
         :plugin/open-preferences "Open plugin preferences file"
         :plugin/restart "Restart App"
-        :plugin/marketplace-tips "If the plugin you installed from marketplace for the first time not work properly, you could try to restart the application."
-        :plugin/unpacked-tips "For development purposes or to load the trusted community plugin from local disk."
+        :plugin/unpacked-tips "Select the plugin directory"
+        :plugin/contribute "✨ Write and submit my plugin"
+        :plugin/marketplace-tips "If the plugin doesn't work correctly when first installed, try to restart Logseq."
         :plugin/up-to-date "It's up to date"
 
         :pdf/copy-ref "Copy ref"