From 7342e1426d9aa1540c026be06deaf0ca95a49aed Mon Sep 17 00:00:00 2001 From: Kimo Knowles Date: Tue, 23 Jul 2024 10:37:11 +0200 Subject: [PATCH] [error-modal] Fix demo --- src/re_com/error_modal.cljs | 2 +- src/re_demo/core.cljs | 11 +---------- src/re_demo/modal_panel.cljs | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/re_com/error_modal.cljs b/src/re_com/error_modal.cljs index 0e7c22ba..94389b06 100644 --- a/src/re_com/error_modal.cljs +++ b/src/re_com/error_modal.cljs @@ -119,7 +119,7 @@ (themed ::sub-title {:label details-title :level :level3}) text/title] [u/part details args] - [u/part error (themed ::error args)]]) + #p (u/part error (themed ::error args))]) (when footer [u/part footer args])]})]]})]})])) diff --git a/src/re_demo/core.cljs b/src/re_demo/core.cljs index 50e8ecc1..8fc0e52c 100644 --- a/src/re_demo/core.cljs +++ b/src/re_demo/core.cljs @@ -259,18 +259,9 @@ :padding "0px 0px 0px 50px" :child [(:panel (item-for-id @selected-tab-id tabs-definition))]]]]]]))) ;; the tab panel to show, for the selected tab -(defn main2 [] - [rc/error-modal - {:src (at) - :what-happened "Something happened" - :implications "Implications" - :what-to-do "Do something." - :footer [:div - [rc/title :level :level3 :label :error-log]]}]) - (defn ^:dev/after-load mount-root [] - (rdom/render [main2] (get-element-by-id "app"))) + (rdom/render [main] (get-element-by-id "app"))) (defn ^:export mount-demo [] diff --git a/src/re_demo/modal_panel.cljs b/src/re_demo/modal_panel.cljs index 872e7bdc..9fb312e7 100644 --- a/src/re_demo/modal_panel.cljs +++ b/src/re_demo/modal_panel.cljs @@ -139,16 +139,16 @@ :on-click (fn [] (reset! show? true) #_(js/setTimeout #(reset! show? false) 3000))] - (when true #_@show? - [error-modal - {:src (at) - :what-happened "Something happened" - :implications "Implications" - :what-to-do "Do something." - :footer [:div - [rc/title :level :level3 :label :error-log]] - :backdrop-on-click #(reset! show? false) - :on-close #(reset! show? false)}])]]))) + (when @show? + [error-modal + {:src (at) + :what-happened "Something happened" + :implications "Implications" + :what-to-do "Do something." + :footer [:div + [rc/title :level :level3 :label :error-log]] + :backdrop-on-click #(reset! show? false) + :on-close #(reset! show? false)}])]]))) (defn panel2 [] [v-box :src (at)