Skip to content

Commit

Permalink
fix: update use of setting-item component to match new api (#17244)
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 authored and ibrkhalil committed Oct 1, 2023
1 parent dae1fab commit 1b3d517
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
14 changes: 8 additions & 6 deletions src/quo2/components/settings/settings_item/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/quo2/components/settings/settings_item/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions src/status_im2/contexts/syncing/device/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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})
27 changes: 13 additions & 14 deletions src/status_im2/contexts/syncing/device/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)}))]))

0 comments on commit 1b3d517

Please sign in to comment.