chore: update group-avatar component (#17014)

We merge it without QA because it only changes the API and doesn't need design review because nothing has been changed 👍
This commit is contained in:
codemaster 2023-08-16 16:44:30 -04:00 committed by GitHub
parent b0f748cb73
commit 673b1afc3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 42 deletions

View File

@ -8,7 +8,7 @@
:align-items :center
:justify-content :center
:border-radius (/ container-size 2)
:background-color
(colors/theme-colors (colors/custom-color customization-color 50)
:overflow :hidden
:background-color (colors/theme-colors (colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme)})

View File

@ -7,34 +7,27 @@
[quo2.components.avatars.group-avatar.style :as style]))
(def sizes
{:icon {:x-small 12
:small 16
:medium 16
:large 20
:x-large 32}
:container {:x-small 20
:small 28
:medium 32
:large 48
:x-large 80}})
{20 {:icon 12}
28 {:icon 16}
32 {:icon 16}
48 {:icon 20}
80 {:icon 32}})
(defn- view-internal
[_]
(fn [{:keys [size theme customization-color picture]
:or {size :x-small
customization-color :blue
picture nil}}]
(let [container-size (get-in sizes [:container size])
icon-size (get-in sizes [:icon size])]
:or {size 20
customization-color :blue}}]
(let [icon-size (get-in sizes [size :icon])]
[rn/view
{:style (style/container {:container-size container-size
{:style (style/container {:container-size size
:customization-color customization-color
:theme theme})}
(if picture
[fast-image/fast-image
{:source picture
:style {:width container-size
:height container-size}}]
:style {:width size
:height size}}]
[icon/icon :i/members
{:size icon-size
:color colors/white-opa-70}])])))

View File

@ -10,28 +10,28 @@
[{:label "Size"
:key :size
:type :select
:options [{:key :x-small
:value "x-small"}
{:key :small
:value "Small"}
{:key :medium
:value "Medium"}
{:key :large
:value "Large"}
{:key :x-large
:value "x-Large"}]}
:options [{:key 20
:value 20}
{:key 28
:value 28}
{:key 32
:value 32}
{:key 48
:value 48}
{:key 80
:value 80}]}
{:label "Avatar"
:key :picture?
:type :boolean}
(preview/customization-color-option)])
(def avatar (resources/get-mock-image :user-picture-male4))
(def avatar (resources/get-mock-image :photo1))
(defn cool-preview
[]
(let [state (reagent/atom {:theme :light
:customization-color :blue
:size :small
:size 20
:picture? false})]
(fn []
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}

View File

@ -141,7 +141,7 @@
:group-avatar [quo2/group-avatar-tag (:label @state)
{:blur? (:blur? @state)
:size :x-small
:size 20
:customization-color :purple}]
:public-key [quo2/public-key-tag

View File

@ -9,7 +9,7 @@
[utils.re-frame :as rf]))
(def tag-params
{:size :small
{:size 20
:customization-color :blue
:style style/user-avatar-tag
:text-style style/user-avatar-tag-text

View File

@ -67,7 +67,7 @@
:context [[common/user-avatar-tag author]
(i18n/label :t/added-you-to)
[quo/group-avatar-tag chat-name
{:size :x-small
{:size 20
:customization-color :purple}]]
:items (when-not (or accepted dismissed)
[{:type :button