From d202b6067421fd86e0965bd0fdf24ecaaefe900d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 2 Apr 2026 17:02:05 +0000 Subject: [PATCH] :recycle: Convert typography-advanced-options to modern * suffix format Rename typography-advanced-options -> typography-advanced-options*, convert props visible?->is-visible, editable?->is-editable, local?->is-local, and update the call site in typography-entry. --- .../sidebar/options/menus/typography.cljs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs index 940682be89..31a2a375ad 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs @@ -462,25 +462,25 @@ [:> spacing-options opts] [:> text-transform-options opts]]])) -(mf/defc typography-advanced-options +(mf/defc typography-advanced-options* {::mf/wrap [mf/memo]} - [{:keys [visible? typography editable? name-input-ref on-close on-change on-name-blur local? navigate-to-library on-key-down]}] + [{:keys [is-visible typography is-editable name-input-ref on-close on-change on-name-blur is-local navigate-to-library on-key-down]}] (let [ref (mf/use-ref nil) font-data (fonts/get-font-data (:font-id typography))] (fonts/ensure-loaded! (:font-id typography)) (mf/use-effect - (mf/deps visible?) + (mf/deps is-visible) (fn [] (when-let [node (mf/ref-val ref)] - (when visible? + (when is-visible (dom/scroll-into-view-if-needed! node))))) - (when visible? + (when is-visible [:div {:ref ref :class (stl/css :advanced-options-wrapper)} - (if ^boolean editable? + (if ^boolean is-editable [:* [:div {:class (stl/css :font-name-wrapper)} [:div {:class (stl/css :typography-sample-input) @@ -544,7 +544,7 @@ [:span {:class (stl/css :info-label)} (tr "workspace.assets.typography.text-transform")] [:span {:class (stl/css :info-content)} (:text-transform typography)]] - (when-not local? + (when-not is-local [:a {:class (stl/css :link-btn) :on-click navigate-to-library} (tr "workspace.assets.typography.go-to-edit")])])]))) @@ -658,14 +658,14 @@ :on-click on-open} deprecated-icon/menu]]] - [:& typography-advanced-options - {:visible? open? + [:> typography-advanced-options* + {:is-visible open? :on-close on-close :typography typography - :editable? editable? + :is-editable editable? :name-input-ref name-input-ref :on-change on-change :on-name-blur on-name-blur :on-key-down on-key-down - :local? local? + :is-local local? :navigate-to-library navigate-to-library}]]))