mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-28 17:36:38 +00:00
fix wrong letter and background color of the channel/group avatar (#19972)
This commit is contained in:
parent
12515a4904
commit
439edc39a6
@ -7,6 +7,7 @@
|
|||||||
(defn outer-container
|
(defn outer-container
|
||||||
[{:keys [size customization-color theme]}]
|
[{:keys [size customization-color theme]}]
|
||||||
(let [container-size (case size
|
(let [container-size (case size
|
||||||
|
:size-80 80
|
||||||
:size-64 64
|
:size-64 64
|
||||||
:size-32 32
|
:size-32 32
|
||||||
24)]
|
24)]
|
||||||
@ -21,6 +22,7 @@
|
|||||||
[size]
|
[size]
|
||||||
{:text-align :center
|
{:text-align :center
|
||||||
:font-size (case size
|
:font-size (case size
|
||||||
|
:size-80 36
|
||||||
:size-64 24
|
:size-64 24
|
||||||
:size-32 15
|
:size-32 15
|
||||||
11)})
|
11)})
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
|
|
||||||
(defn- initials
|
(defn- initials
|
||||||
[{:keys [full-name size customization-color theme]}]
|
[{:keys [full-name size customization-color theme]}]
|
||||||
(let [amount-initials (if (#{:size-32 :size-64} size) 2 1)
|
(let [amount-initials (if (#{:size-32 :size-64 :size-80} size) 2 1)
|
||||||
channel-name (utils.string/safe-replace full-name "#" "")]
|
channel-name (utils.string/safe-replace full-name "#" "")]
|
||||||
[text/text
|
[text/text
|
||||||
(cond-> {:accessibility-label :initials
|
(cond-> {:accessibility-label :initials
|
||||||
:style {:color (colors/resolve-color customization-color theme)}
|
:style {:color (colors/resolve-color customization-color theme)}
|
||||||
:size :paragraph-2
|
:size :paragraph-2
|
||||||
:weight :semi-bold}
|
:weight :semi-bold}
|
||||||
(= size :size-64) (assoc :size :heading-1
|
(#{:size-64 :size-80} size) (assoc :size :heading-1
|
||||||
:weight :medium))
|
:weight :medium))
|
||||||
(utils.string/get-initials channel-name amount-initials)]))
|
(utils.string/get-initials channel-name amount-initials)]))
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
(ns quo.components.avatars.group-avatar.view
|
(ns quo.components.avatars.group-avatar.view
|
||||||
(:require
|
(:require
|
||||||
[clojure.string :as string]
|
|
||||||
[quo.components.avatars.group-avatar.style :as style]
|
[quo.components.avatars.group-avatar.style :as style]
|
||||||
[quo.components.icon :as icon]
|
[quo.components.icon :as icon]
|
||||||
[quo.components.markdown.text :as text]
|
[quo.components.markdown.text :as text]
|
||||||
@ -22,7 +21,7 @@
|
|||||||
:container 80}})
|
:container 80}})
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[{:keys [size customization-color picture icon-name emoji chat-name]
|
[{:keys [size customization-color picture icon-name emoji]
|
||||||
:or {size :size-20
|
:or {size :size-20
|
||||||
customization-color :blue
|
customization-color :blue
|
||||||
picture nil
|
picture nil
|
||||||
@ -50,14 +49,6 @@
|
|||||||
{:size :paragraph-1
|
{:size :paragraph-1
|
||||||
:style (dissoc (style/avatar-identifier theme) :font-size)}
|
:style (dissoc (style/avatar-identifier theme) :font-size)}
|
||||||
emoji])
|
emoji])
|
||||||
chat-name
|
|
||||||
(if (= size :size-80)
|
|
||||||
[rn/text
|
|
||||||
{:style (style/avatar-identifier theme)}
|
|
||||||
((comp first string/upper-case) chat-name)]
|
|
||||||
[text/text
|
|
||||||
{:size :paragraph-1}
|
|
||||||
((comp first string/upper-case) chat-name)])
|
|
||||||
:else
|
:else
|
||||||
[icon/icon icon-name
|
[icon/icon icon-name
|
||||||
{:size icon-size
|
{:size icon-size
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
{:position :absolute
|
{:position :absolute
|
||||||
:border-width 4
|
:border-width 4
|
||||||
:border-radius 50
|
:border-radius 50
|
||||||
|
:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
|
||||||
:border-color (colors/theme-colors colors/white colors/neutral-95 theme)}))
|
:border-color (colors/theme-colors colors/white colors/neutral-95 theme)}))
|
||||||
|
|
||||||
(defn user-name-container
|
(defn user-name-container
|
||||||
|
@ -133,15 +133,21 @@
|
|||||||
community-channel? (= chat-type constants/community-chat-type)]
|
community-channel? (= chat-type constants/community-chat-type)]
|
||||||
[reanimated/view
|
[reanimated/view
|
||||||
{:style (style/header-image scale top left theme)}
|
{:style (style/header-image scale top left theme)}
|
||||||
(if group-chat
|
(cond
|
||||||
|
community-channel?
|
||||||
|
[quo/channel-avatar
|
||||||
|
{:size :size-80
|
||||||
|
:full-name chat-name
|
||||||
|
:customization-color color
|
||||||
|
:emoji (when-not (string/blank? emoji)
|
||||||
|
(string/trim emoji))}]
|
||||||
|
group-chat
|
||||||
[quo/group-avatar
|
[quo/group-avatar
|
||||||
{:customization-color color
|
{:customization-color color
|
||||||
:size :size-80
|
:size :size-80
|
||||||
:picture profile-picture
|
:picture profile-picture
|
||||||
:emoji (when (and (not (string/blank? emoji))
|
|
||||||
community-channel?)
|
|
||||||
(string/trim emoji))
|
|
||||||
:chat-name chat-name}]
|
:chat-name chat-name}]
|
||||||
|
:else
|
||||||
[quo/user-avatar
|
[quo/user-avatar
|
||||||
{:full-name display-name
|
{:full-name display-name
|
||||||
:online? online?
|
:online? online?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user