fix: update use of setting-item component to match new api (#17244)

This commit is contained in:
Jamie Caprani 2023-09-19 14:05:07 +02:00 committed by GitHub
parent 5d6800cee0
commit 6eb53ca2db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 28 deletions

View File

@ -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

View File

@ -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

View File

@ -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})

View File

@ -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)}))]))