From 6eb53ca2db01c4f786545ad54c26e1947d56d1db Mon Sep 17 00:00:00 2001 From: Jamie Caprani Date: Tue, 19 Sep 2023 14:05:07 +0200 Subject: [PATCH] fix: update use of setting-item component to match new api (#17244) --- .../settings/settings_item/style.cljs | 14 +++++----- .../settings/settings_item/view.cljs | 3 ++- .../contexts/syncing/device/style.cljs | 11 +++----- .../contexts/syncing/device/view.cljs | 27 +++++++++---------- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/quo2/components/settings/settings_item/style.cljs b/src/quo2/components/settings/settings_item/style.cljs index b623e23e32..07d02d0fa2 100644 --- a/src/quo2/components/settings/settings_item/style.cljs +++ b/src/quo2/components/settings/settings_item/style.cljs @@ -8,12 +8,14 @@ (if tag 72 icon-height))) (defn container - [{:keys [in-card? tag]}] - {:padding-horizontal 12 - :padding-vertical (if in-card? 12 13) - :flex-direction :row - :justify-content :space-between - :height (if tag 96 48)}) + [{:keys [in-card? tag container-style]}] + (merge {:padding-horizontal 12 + :padding-top (if in-card? 12 13) + :padding-bottom (if in-card? 12 13) + :flex-direction :row + :justify-content :space-between + :height (if tag 96 48)} + container-style)) (def sub-container {:flex-direction :row diff --git a/src/quo2/components/settings/settings_item/view.cljs b/src/quo2/components/settings/settings_item/view.cljs index 93aaeb17f5..9b6813bca6 100644 --- a/src/quo2/components/settings/settings_item/view.cljs +++ b/src/quo2/components/settings/settings_item/view.cljs @@ -62,7 +62,8 @@ (case tag :positive [status-tags/status-tag {:status {:type :positive} - :label (i18n/label :t/positive) + :label (:label tag-props) + :no-icon? true :size :small :container-style {:margin-top 8}}] :context [context-tag/view diff --git a/src/status_im2/contexts/syncing/device/style.cljs b/src/status_im2/contexts/syncing/device/style.cljs index 12a5b37cb3..4bf7747684 100644 --- a/src/status_im2/contexts/syncing/device/style.cljs +++ b/src/status_im2/contexts/syncing/device/style.cljs @@ -2,10 +2,7 @@ (:require [quo2.foundations.colors :as colors])) (def device-container - {:padding-top 12 - :padding-horizontal 12 - :padding-bottom 16 - :border-color colors/white-opa-5 - :border-radius 16 - :border-width 1 - :margin-top 12}) + {:border-color colors/white-opa-5 + :border-radius 16 + :border-width 1 + :margin-top 12}) diff --git a/src/status_im2/contexts/syncing/device/view.cljs b/src/status_im2/contexts/syncing/device/view.cljs index 3b1da7bf5e..a59db907c8 100644 --- a/src/status_im2/contexts/syncing/device/view.cljs +++ b/src/status_im2/contexts/syncing/device/view.cljs @@ -16,21 +16,20 @@ (cond-> {:container-style style/device-container :title name - :override-theme :dark - :left-icon (cond (#{:mobile :ios :android} (keyword device-type)) + :image :icon + :image-props (cond (#{:mobile :ios :android} (keyword device-type)) :i/mobile :else :i/desktop)} - (and show-button? unpaired?) (assoc :button-props - {:title (i18n/label :t/pair) - :on-press #(js/alert "feature not added yet")}) - (and show-button? paired?) (assoc - :button-props - {:title (i18n/label :t/unpair) + (and show-button? unpaired?) (assoc + :action :button + :action-props + {:title (i18n/label :t/pair) :on-press #(js/alert "feature not added yet")}) + (and show-button? paired?) (assoc + :action :button + :action-props + {:button-text (i18n/label :t/unpair) + :on-press #(js/alert "feature not added yet")}) this-device? (assoc - :status-tag-props - {:size :small - :status {:type :positive} - :no-icon? true - :label (i18n/label :t/this-device) - :override-theme :dark}))])) + :tag :positive + :tag-props {:label (i18n/label :t/this-device)}))]))