ソースを参照

Fix filter icon not changing color

samfundev 5 年 前
コミット
389c4a9fd8

+ 5 - 6
src/main/frontend/components/reference.cljs

@@ -96,12 +96,11 @@
                                         (str n-ref " Linked References"))]
             [:a {:title "Filter"
                  :on-click #(state/set-modal! (filter-dialog references page-name))}
-             [:span {:class (cond
-                              (empty? filter-state) nil
-                              (every? true? (vals filter-state)) "text-green-500"
-                              (every? false? (vals filter-state)) "text-red-500"
-                              :else "text-yellow-200")}
-              (svg/filter-icon)]]]
+              (svg/filter-icon (cond
+                                 (empty? filter-state) nil
+                                 (every? true? (vals filter-state)) "text-green-500"
+                                 (every? false? (vals filter-state)) "text-red-500"
+                                 :else "text-yellow-200"))]]
            [:div.references-blocks
             (let [ref-hiccup (block/->hiccup filtered-ref-blocks
                                              {:id page-name

+ 3 - 2
src/main/frontend/components/svg.cljs

@@ -433,12 +433,13 @@
   (hero-icon "M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"))
 
 (rum/defc filter-icon
-  []
+  [class]
   [:svg
    {:stroke "currentColor"
     :fill "currentColor"
     :view-box "0 0 16.06 16.06"
     :width "16"
-    :height "16"}
+    :height "16"
+    :class class }
    [:path
     {:d "M.53.53h15l-5 7v8h-5v-8z" :stroke-width "1.06" :stroke-linejoin "round"}]])