Skip to content

Commit

Permalink
[error-modal] Adjust close button style & state management
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Aug 8, 2024
1 parent 093a209 commit f5200f5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/re_com/error_modal.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
[re-com.text :as text]
[re-com.util :as u :refer [deref-or-value px]]))

(defn close-button [props]
(defn close-button [_]
(let [hover? (r/atom nil)]
[:div {:on-mouse-enter (partial reset! hover? true)
:on-mouse-leave (partial reset! hover? false)
:style {:padding "12px 7px 7px 7px"}}
[u/x-button (merge props {:width "12px"
:height "12px"
:hover? hover? :stroke-width "1.2px"})]]))
(fn [{:keys [on-click] :as props}]
[:div {:on-mouse-enter (partial reset! hover? true)
:on-mouse-leave (partial reset! hover? false)
:on-click on-click
:style {:padding "12px 7px 7px 7px"}}
[u/x-button (merge props {:width "12px"
:height "12px"
:hover? hover?
:stroke (if @hover? "#000000" "#ffffff")
:stroke-width "1.2px"})]])))

(defn error-modal
[& {:keys [severity title
Expand Down

0 comments on commit f5200f5

Please sign in to comment.