From 70b570f112101157d76bc5cc101b6bb94c128122 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Mon, 26 Aug 2024 13:49:57 +0200 Subject: [PATCH] Show only on create --- .../src/app/main/ui/workspace/tokens/modals/themes.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/modals/themes.cljs b/frontend/src/app/main/ui/workspace/tokens/modals/themes.cljs index 8c7eaecd5..adfc659b0 100644 --- a/frontend/src/app/main/ui/workspace/tokens/modals/themes.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/modals/themes.cljs @@ -98,7 +98,8 @@ (mf/defc edit-theme [{:keys [token-sets theme on-back] :as props}] - (let [theme-state (mf/use-state {:token-sets token-sets + (let [edit? (some? (:id theme)) + theme-state (mf/use-state {:token-sets token-sets :theme theme}) token-set-active? (mf/use-callback (mf/deps theme-state) @@ -134,7 +135,8 @@ :on-select on-toggle-token-set :on-toggle on-toggle-token-set}]] [:div {:class (stl/css :edit-theme-footer)} - [:button {:class (stl/css :button-secondary)} "Delete"] + (when edit? + [:button {:class (stl/css :button-secondary)} "Delete"]) [:div {:class (stl/css :button-footer)} [:button {:class (stl/css :button-secondary)} "Cancel"] [:button {:class (stl/css :button-primary)} "Save theme"]]]]))