[#17300] fix: syncing device indicator color and some alignment (#17340)

This commit is contained in:
Mohsen Ghafouri 2023-09-25 11:55:54 +03:00 committed by GitHub
parent 7e646f7823
commit 848cac31ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 20 deletions

View File

@ -1,22 +1,18 @@
(ns quo2.components.settings.settings-item.style (ns quo2.components.settings.settings-item.style
(:require [quo2.foundations.colors :as colors])) (:require [quo2.foundations.colors :as colors]))
(defn find-icon-height
[description tag image]
(let [icon-height (if (= image :icon-avatar) 32 20)
icon-height (if description 40 icon-height)]
(if tag 72 icon-height)))
(defn container (defn container
[{:keys [in-card? tag container-style]}] [{:keys [container-style]}]
(merge {:padding-horizontal 12 (merge {:padding 12
:padding-top (if in-card? 12 13) :flex-direction :row
:padding-bottom (if in-card? 12 13) :justify-content :space-between}
:flex-direction :row
:justify-content :space-between
:height (if tag 96 48)}
container-style)) container-style))
(defn left-sub-container
[{:keys [tag description]}]
{:flex-direction :row
:align-items (if (or tag description) :flex-start :center)})
(def sub-container (def sub-container
{:flex-direction :row {:flex-direction :row
:align-items :center}) :align-items :center})
@ -24,12 +20,12 @@
(def left-container (def left-container
{:margin-left 12 {:margin-left 12
:height "100%" :height "100%"
:justify-content :center}) :justify-content :flex-start})
(defn image-container (defn image-container
[description tag image] [image tag description]
{:height (find-icon-height description tag image) {:height (if (= image :icon-avatar) 32 20)
:justify-content :flex-start}) :margin-top (if (or tag description) 1 0)})
(def status-container (def status-container
{:flex-direction :row {:flex-direction :row
@ -57,3 +53,8 @@
:height 15 :height 15
:border-radius 12 :border-radius 12
:background-color background-color}) :background-color background-color})
(def status-tag-container
{:margin-top 7
:margin-bottom 2
:margin-left -1})

View File

@ -65,7 +65,7 @@
:label (:label tag-props) :label (:label tag-props)
:no-icon? true :no-icon? true
:size :small :size :small
:container-style {:margin-top 8}}] :container-style style/status-tag-container}]
:context [context-tag/view :context [context-tag/view
(merge tag-props (merge tag-props
{:type :icon {:type :icon
@ -105,7 +105,7 @@
{:style (style/container props) {:style (style/container props)
:on-press on-press :on-press on-press
:accessibility-label accessibility-label} :accessibility-label accessibility-label}
[rn/view {:style style/sub-container} [rn/view {:style (style/left-sub-container props)}
[image-component props] [image-component props]
[rn/view {:style style/left-container} [rn/view {:style style/left-container}
[text/text {:weight :medium} title] [text/text {:weight :medium} title]

View File

@ -5,4 +5,4 @@
{:border-color colors/white-opa-5 {:border-color colors/white-opa-5
:border-radius 16 :border-radius 16
:border-width 1 :border-width 1
:margin-top 12}) :margin-top 11})

View File

@ -16,6 +16,7 @@
(cond-> (cond->
{:container-style style/device-container {:container-style style/device-container
:title name :title name
:blur? true
:image :icon :image :icon
:image-props (cond (#{:mobile :ios :android} (keyword device-type)) :image-props (cond (#{:mobile :ios :android} (keyword device-type))
:i/mobile :i/mobile