Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd3a1172b3 | ||
|
|
8c9d351f14 | ||
|
|
3e93aba011 | ||
|
|
8d43a6d5be |
@@ -1,138 +0,0 @@
|
|||||||
(ns quo2.components.avatars.user-avatar
|
|
||||||
(:require [clojure.string :as string]
|
|
||||||
[quo2.components.markdown.text :as text]
|
|
||||||
[quo2.foundations.colors :as colors]
|
|
||||||
[quo2.theme :refer [dark?]]
|
|
||||||
[react-native.core :as rn]
|
|
||||||
[react-native.fast-image :as fast-image]))
|
|
||||||
|
|
||||||
(def sizes
|
|
||||||
{:big {:outer 80
|
|
||||||
:inner 72
|
|
||||||
:status-indicator 20
|
|
||||||
:status-indicator-border 4
|
|
||||||
:font-size :heading-1}
|
|
||||||
:medium {:outer 48
|
|
||||||
:inner 44
|
|
||||||
:status-indicator 12
|
|
||||||
:status-indicator-border 2
|
|
||||||
:font-size :paragraph-1}
|
|
||||||
:small {:outer 32
|
|
||||||
:inner 28
|
|
||||||
:status-indicator 12
|
|
||||||
:status-indicator-border 2
|
|
||||||
:font-size :paragraph-2}
|
|
||||||
:xs {:outer 24
|
|
||||||
:inner 24
|
|
||||||
:status-indicator 0
|
|
||||||
:status-indicator-border 0
|
|
||||||
:font-size :paragraph-2}
|
|
||||||
:xxs {:outer 20
|
|
||||||
:inner 20
|
|
||||||
:status-indicator 0
|
|
||||||
:status-indicator-border 0
|
|
||||||
:font-size :label}
|
|
||||||
:xxxs {:outer 16
|
|
||||||
:inner 16
|
|
||||||
:status-indicator 0
|
|
||||||
:status-indicator-border 0
|
|
||||||
:font-size :label}})
|
|
||||||
|
|
||||||
(defn dot-indicator
|
|
||||||
[{:keys [size online? ring? dark?]}]
|
|
||||||
(let [dimensions (get-in sizes [size :status-indicator])
|
|
||||||
border-width (get-in sizes [size :status-indicator-border])
|
|
||||||
right (case size
|
|
||||||
:big 2
|
|
||||||
:medium 0
|
|
||||||
:small -2
|
|
||||||
0)
|
|
||||||
bottom (case size
|
|
||||||
:big (if ring? -1 2)
|
|
||||||
:medium (if ring? 0 -2)
|
|
||||||
:small -2
|
|
||||||
0)]
|
|
||||||
[rn/view
|
|
||||||
{:style {:background-color (if online?
|
|
||||||
colors/success-50
|
|
||||||
colors/neutral-40)
|
|
||||||
:width dimensions
|
|
||||||
:height dimensions
|
|
||||||
:border-width border-width
|
|
||||||
:border-radius dimensions
|
|
||||||
:border-color (if dark?
|
|
||||||
colors/neutral-100
|
|
||||||
colors/white)
|
|
||||||
:position :absolute
|
|
||||||
:bottom bottom
|
|
||||||
:right right}}]))
|
|
||||||
|
|
||||||
(defn initials-style
|
|
||||||
[inner-dimensions outer-dimensions]
|
|
||||||
{:position :absolute
|
|
||||||
:top (/ (- outer-dimensions inner-dimensions) 2)
|
|
||||||
:left (/ (- outer-dimensions inner-dimensions) 2)
|
|
||||||
:width inner-dimensions
|
|
||||||
:height inner-dimensions
|
|
||||||
:border-radius inner-dimensions
|
|
||||||
:justify-content :center
|
|
||||||
:align-items :center
|
|
||||||
:background-color (colors/custom-color-by-theme :turquoise 50 60)})
|
|
||||||
|
|
||||||
(defn outer-styles
|
|
||||||
[outer-dimensions]
|
|
||||||
{:width outer-dimensions
|
|
||||||
:height outer-dimensions
|
|
||||||
:border-radius outer-dimensions})
|
|
||||||
|
|
||||||
(def one-initial-letter-sizes #{:xs :xxs :xxxs})
|
|
||||||
(def valid-ring-sizes #{:big :medium :small})
|
|
||||||
|
|
||||||
(defn initials-avatar
|
|
||||||
[{:keys [full-name size inner-dimensions outer-dimensions]}]
|
|
||||||
(let [amount-initials (if (one-initial-letter-sizes size) 1 2)
|
|
||||||
initials (as-> full-name $
|
|
||||||
(string/split $ " ")
|
|
||||||
(map (comp string/upper-case first) $)
|
|
||||||
(take amount-initials $)
|
|
||||||
(string/join $))
|
|
||||||
font-size (get-in sizes [size :font-size])]
|
|
||||||
[rn/view {:style (initials-style inner-dimensions outer-dimensions)}
|
|
||||||
[text/text
|
|
||||||
{:style {:color colors/white-opa-70}
|
|
||||||
:weight :semi-bold
|
|
||||||
:size font-size}
|
|
||||||
initials]]))
|
|
||||||
|
|
||||||
(defn user-avatar
|
|
||||||
"If no `profile-picture` is given, draws the initials based on the `full-name` and
|
|
||||||
uses `ring-background` to display the ring behind the initials when given. Otherwise,
|
|
||||||
shows the profile picture which already comes with the ring drawn over it."
|
|
||||||
[{:keys [full-name status-indicator? online? size profile-picture ring-background]
|
|
||||||
:or {status-indicator? true
|
|
||||||
online? true
|
|
||||||
size :big}}]
|
|
||||||
(let [full-name (or full-name "empty name")
|
|
||||||
draw-ring? (and ring-background (valid-ring-sizes size))
|
|
||||||
outer-dimensions (get-in sizes [size :outer])
|
|
||||||
inner-dimensions (get-in sizes [size (if draw-ring? :inner :outer)])]
|
|
||||||
[rn/view
|
|
||||||
{:style (outer-styles outer-dimensions)
|
|
||||||
:accessibility-label :user-avatar}
|
|
||||||
;; The `profile-picture` already has the ring in it
|
|
||||||
(when-let [image (or profile-picture ring-background)]
|
|
||||||
[fast-image/fast-image
|
|
||||||
{:style (outer-styles outer-dimensions)
|
|
||||||
:source image}])
|
|
||||||
(when-not profile-picture
|
|
||||||
[initials-avatar
|
|
||||||
{:full-name full-name
|
|
||||||
:size size
|
|
||||||
:inner-dimensions inner-dimensions
|
|
||||||
:outer-dimensions outer-dimensions}])
|
|
||||||
(when status-indicator?
|
|
||||||
[dot-indicator
|
|
||||||
{:size size
|
|
||||||
:online? online?
|
|
||||||
:ring? draw-ring?
|
|
||||||
:dark? (dark?)}])]))
|
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
(ns quo2.components.avatars.user-avatar.component-spec
|
||||||
|
(:require [quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||||
|
[status-im2.common.resources :as resources]
|
||||||
|
[test-helpers.component :as h]))
|
||||||
|
|
||||||
|
(defn- test-truthy [element]
|
||||||
|
(.toBeTruthy (js/expect element)))
|
||||||
|
|
||||||
|
(defn- test-null [element]
|
||||||
|
(.toBeNull (js/expect element)))
|
||||||
|
|
||||||
|
(h/describe "user avatar"
|
||||||
|
(h/test "Default render"
|
||||||
|
(h/render [user-avatar/user-avatar])
|
||||||
|
(test-truthy (h/get-by-label-text :user-avatar))
|
||||||
|
(test-truthy (h/get-by-text "EN")))
|
||||||
|
|
||||||
|
(h/describe "Profile picture"
|
||||||
|
(h/test "Renders"
|
||||||
|
(h/render
|
||||||
|
[user-avatar/user-avatar {:profile-picture (resources/get-mock-image :user-picture-male4)}])
|
||||||
|
(test-truthy (h/get-by-label-text :profile-picture)))
|
||||||
|
|
||||||
|
(h/test "Renders even if `:full-name` is passed"
|
||||||
|
(h/render
|
||||||
|
[user-avatar/user-avatar {:profile-picture (resources/get-mock-image :user-picture-male4)
|
||||||
|
:full-name "New User1"}])
|
||||||
|
(test-truthy (h/get-by-label-text :profile-picture))
|
||||||
|
(test-null (h/query-by-label-text :initials-avatar)))
|
||||||
|
|
||||||
|
(h/describe "Status indicator"
|
||||||
|
(h/test "Render"
|
||||||
|
(h/render
|
||||||
|
[user-avatar/user-avatar {:profile-picture (resources/get-mock-image :user-picture-male4)
|
||||||
|
:status-indicator? true}])
|
||||||
|
(test-truthy (h/get-by-label-text :profile-picture))
|
||||||
|
(test-truthy (h/get-by-label-text :status-indicator)))
|
||||||
|
|
||||||
|
(h/test "Do not render"
|
||||||
|
(h/render
|
||||||
|
[user-avatar/user-avatar {:profile-picture (resources/get-mock-image :user-picture-male4)
|
||||||
|
:status-indicator? false}])
|
||||||
|
(test-truthy (h/get-by-label-text :profile-picture))
|
||||||
|
(test-null (h/query-by-label-text :status-indicator)))))
|
||||||
|
|
||||||
|
(h/describe "Initials Avatar"
|
||||||
|
(h/describe "Render initials"
|
||||||
|
(letfn [(user-avatar-component [size]
|
||||||
|
[user-avatar/user-avatar {:full-name "New User"
|
||||||
|
:size size}])]
|
||||||
|
(h/describe "Two letters"
|
||||||
|
(h/test "Size :big"
|
||||||
|
(h/render (user-avatar-component :big))
|
||||||
|
(test-truthy (h/get-by-text "NU")))
|
||||||
|
|
||||||
|
(h/test "Size :medium"
|
||||||
|
(h/render (user-avatar-component :medium))
|
||||||
|
(test-truthy (h/get-by-text "NU")))
|
||||||
|
|
||||||
|
(h/test "Size :small"
|
||||||
|
(h/render (user-avatar-component :small))
|
||||||
|
(test-truthy (h/get-by-text "NU"))))
|
||||||
|
|
||||||
|
(h/describe "One letter"
|
||||||
|
(h/test "Size :xs"
|
||||||
|
(h/render (user-avatar-component :xs))
|
||||||
|
(test-truthy (h/get-by-text "N")))
|
||||||
|
|
||||||
|
(h/test "Size :xxs"
|
||||||
|
(h/render (user-avatar-component :xxs))
|
||||||
|
(test-truthy (h/get-by-text "N")))
|
||||||
|
|
||||||
|
(h/test "Size :xxxs"
|
||||||
|
(h/render (user-avatar-component :xxxs))
|
||||||
|
(test-truthy (h/get-by-text "N"))))))
|
||||||
|
|
||||||
|
(h/describe "Render ring"
|
||||||
|
(letfn [(user-avatar-component [size]
|
||||||
|
[user-avatar/user-avatar {:full-name "New User"
|
||||||
|
:ring-background (resources/get-mock-image :ring)
|
||||||
|
:size size}])]
|
||||||
|
(h/describe "Passed and drawn"
|
||||||
|
(h/test "Size :big"
|
||||||
|
(h/render (user-avatar-component :big))
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-truthy (h/get-by-label-text :ring-background)))
|
||||||
|
|
||||||
|
(h/test "Size :medium"
|
||||||
|
(h/render (user-avatar-component :medium))
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-truthy (h/get-by-label-text :ring-background)))
|
||||||
|
|
||||||
|
(h/test "Size :small"
|
||||||
|
(h/render (user-avatar-component :small))
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-truthy (h/get-by-label-text :ring-background))))
|
||||||
|
|
||||||
|
(h/describe "Passed and not drawn (because of invalid size for ring)"
|
||||||
|
(h/test "Size :xs"
|
||||||
|
(h/render (user-avatar-component :xs))
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-null (h/query-by-label-text :ring-background)))
|
||||||
|
|
||||||
|
(h/test "Size :xxs"
|
||||||
|
(h/render (user-avatar-component :xxs))
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-null (h/query-by-label-text :ring-background)))
|
||||||
|
|
||||||
|
(h/test "Size :xxxs"
|
||||||
|
(h/render (user-avatar-component :xxxs))
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-null (h/query-by-label-text :ring-background))))))
|
||||||
|
|
||||||
|
(h/describe "Status indicator"
|
||||||
|
(h/test "Render"
|
||||||
|
(h/render
|
||||||
|
[user-avatar/user-avatar {:full-name "Test User"
|
||||||
|
:status-indicator? true}])
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-truthy (h/get-by-label-text :status-indicator)))
|
||||||
|
|
||||||
|
(h/test "Do not render"
|
||||||
|
(h/render
|
||||||
|
[user-avatar/user-avatar {:full-name "Test User"
|
||||||
|
:status-indicator? false}])
|
||||||
|
(test-truthy (h/get-by-label-text :initials-avatar))
|
||||||
|
(test-null (h/query-by-label-text :status-indicator))))))
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
(ns quo2.components.avatars.user-avatar.style
|
||||||
|
(:require [quo2.foundations.colors :as colors]))
|
||||||
|
|
||||||
|
(def sizes
|
||||||
|
{:big {:outer 80
|
||||||
|
:inner 72
|
||||||
|
:status-indicator 20
|
||||||
|
:status-indicator-border 4
|
||||||
|
:font-size :heading-1}
|
||||||
|
:medium {:outer 48
|
||||||
|
:inner 44
|
||||||
|
:status-indicator 12
|
||||||
|
:status-indicator-border 2
|
||||||
|
:font-size :paragraph-1}
|
||||||
|
:small {:outer 32
|
||||||
|
:inner 28
|
||||||
|
:status-indicator 12
|
||||||
|
:status-indicator-border 2
|
||||||
|
:font-size :paragraph-2}
|
||||||
|
:xs {:outer 24
|
||||||
|
:inner 24
|
||||||
|
:status-indicator 0
|
||||||
|
:status-indicator-border 0
|
||||||
|
:font-size :paragraph-2}
|
||||||
|
:xxs {:outer 20
|
||||||
|
:inner 20
|
||||||
|
:status-indicator 0
|
||||||
|
:status-indicator-border 0
|
||||||
|
:font-size :label}
|
||||||
|
:xxxs {:outer 16
|
||||||
|
:inner 16
|
||||||
|
:status-indicator 0
|
||||||
|
:status-indicator-border 0
|
||||||
|
:font-size :label}})
|
||||||
|
|
||||||
|
(defn outer
|
||||||
|
[size]
|
||||||
|
(let [dimensions (get-in sizes [size :outer])]
|
||||||
|
{:width dimensions
|
||||||
|
:height dimensions
|
||||||
|
:border-radius dimensions}))
|
||||||
|
|
||||||
|
(defn initials-avatar
|
||||||
|
[size draw-ring?]
|
||||||
|
(let [outer-dimensions (get-in sizes [size :outer])
|
||||||
|
inner-dimensions (get-in sizes [size (if draw-ring? :inner :outer)])]
|
||||||
|
{:position :absolute
|
||||||
|
:top (/ (- outer-dimensions inner-dimensions) 2)
|
||||||
|
:left (/ (- outer-dimensions inner-dimensions) 2)
|
||||||
|
:width inner-dimensions
|
||||||
|
:height inner-dimensions
|
||||||
|
:border-radius inner-dimensions
|
||||||
|
:justify-content :center
|
||||||
|
:align-items :center
|
||||||
|
:background-color (colors/custom-color-by-theme :turquoise 50 60)}))
|
||||||
|
|
||||||
|
(def initials-avatar-text
|
||||||
|
{:color colors/white-opa-70})
|
||||||
|
|
||||||
|
(defn dot
|
||||||
|
[size online? ring?]
|
||||||
|
(let [background (if online? colors/success-50 colors/neutral-40)
|
||||||
|
dimensions (get-in sizes [size :status-indicator])
|
||||||
|
border-width (get-in sizes [size :status-indicator-border])
|
||||||
|
right (case size
|
||||||
|
:big 2
|
||||||
|
:medium 0
|
||||||
|
:small -2
|
||||||
|
0)
|
||||||
|
bottom (case size
|
||||||
|
:big (if ring? -1 2)
|
||||||
|
:medium (if ring? 0 -2)
|
||||||
|
:small -2
|
||||||
|
0)]
|
||||||
|
{:position :absolute
|
||||||
|
:bottom bottom
|
||||||
|
:right right
|
||||||
|
:width dimensions
|
||||||
|
:height dimensions
|
||||||
|
:border-width border-width
|
||||||
|
:border-radius dimensions
|
||||||
|
:border-color (colors/theme-colors colors/white colors/neutral-100)
|
||||||
|
:background-color background}))
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
(ns quo2.components.avatars.user-avatar.view
|
||||||
|
(:require [clojure.string :as string]
|
||||||
|
[quo2.components.avatars.user-avatar.style :as style]
|
||||||
|
[quo2.components.markdown.text :as text]
|
||||||
|
[react-native.core :as rn]
|
||||||
|
[react-native.fast-image :as fast-image]))
|
||||||
|
|
||||||
|
(defn- extract-initials
|
||||||
|
[full-name amount-initials]
|
||||||
|
(let [upper-case-first-letter (comp string/upper-case first)
|
||||||
|
names-list (string/split full-name " ")]
|
||||||
|
(->> names-list
|
||||||
|
(map upper-case-first-letter)
|
||||||
|
(take amount-initials)
|
||||||
|
(string/join))))
|
||||||
|
|
||||||
|
(defn initials-avatar
|
||||||
|
[{:keys [full-name size draw-ring?]}]
|
||||||
|
(let [font-size (get-in style/sizes [size :font-size])
|
||||||
|
amount-initials (if (#{:xs :xxs :xxxs} size) 1 2)]
|
||||||
|
[rn/view {:accessibility-label :initials-avatar
|
||||||
|
:style (style/initials-avatar size draw-ring?)}
|
||||||
|
[text/text
|
||||||
|
{:style style/initials-avatar-text
|
||||||
|
:size font-size
|
||||||
|
:weight :semi-bold}
|
||||||
|
(extract-initials full-name amount-initials)]]))
|
||||||
|
|
||||||
|
(def valid-ring-sizes #{:big :medium :small})
|
||||||
|
|
||||||
|
(defn user-avatar
|
||||||
|
"If no `profile-picture` is given, draws the initials based on the `full-name` and
|
||||||
|
uses `ring-background` to display the ring behind the initials when given. Otherwise,
|
||||||
|
shows the `profile-picture` which already comes with the ring drawn."
|
||||||
|
[{:keys [full-name status-indicator? online? size profile-picture ring-background]
|
||||||
|
:or {status-indicator? true
|
||||||
|
online? true
|
||||||
|
size :big}}]
|
||||||
|
(let [full-name (or full-name "empty name")
|
||||||
|
draw-ring? (and ring-background (valid-ring-sizes size))
|
||||||
|
outer-styles (style/outer size)]
|
||||||
|
[rn/view {:style outer-styles :accessibility-label :user-avatar}
|
||||||
|
;; The `profile-picture` already has the ring in it
|
||||||
|
(when-let [image (or profile-picture ring-background)]
|
||||||
|
[fast-image/fast-image
|
||||||
|
{:accessibility-label (if draw-ring? :ring-background :profile-picture)
|
||||||
|
:style outer-styles
|
||||||
|
:source image}])
|
||||||
|
(when-not profile-picture
|
||||||
|
[initials-avatar
|
||||||
|
{:full-name full-name
|
||||||
|
:size size
|
||||||
|
:draw-ring? draw-ring?}])
|
||||||
|
(when status-indicator?
|
||||||
|
[rn/view {:accessibility-label :status-indicator
|
||||||
|
:style (style/dot size online? draw-ring?)}])]))
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
(ns quo2.components.list-items.preview-list
|
(ns quo2.components.list-items.preview-list
|
||||||
(:require [quo2.components.avatars.user-avatar :as user-avatar]
|
(:require [quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||||
[quo2.components.icon :as quo2.icons]
|
[quo2.components.icon :as quo2.icons]
|
||||||
[quo2.components.markdown.text :as quo2.text]
|
[quo2.components.markdown.text :as quo2.text]
|
||||||
[quo2.foundations.colors :as colors]
|
[quo2.foundations.colors :as colors]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
(ns quo2.components.list-items.user-list
|
(ns quo2.components.list-items.user-list
|
||||||
(:require [react-native.core :as rn]
|
(:require [react-native.core :as rn]
|
||||||
[quo2.components.avatars.user-avatar :as user-avatar]
|
[quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||||
[quo2.components.markdown.text :as text]
|
[quo2.components.markdown.text :as text]
|
||||||
[quo2.components.icon :as icons]
|
[quo2.components.icon :as icons]
|
||||||
[quo2.foundations.colors :as colors]
|
[quo2.foundations.colors :as colors]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
(ns quo2.components.messages.system-message
|
(ns quo2.components.messages.system-message
|
||||||
(:require [quo2.components.avatars.icon-avatar :as icon-avatar]
|
(:require [quo2.components.avatars.icon-avatar :as icon-avatar]
|
||||||
[quo2.components.avatars.user-avatar :as user-avatar]
|
[quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||||
[quo2.components.markdown.text :as text]
|
[quo2.components.markdown.text :as text]
|
||||||
[quo2.foundations.colors :as colors]
|
[quo2.foundations.colors :as colors]
|
||||||
[quo2.theme :as theme]
|
[quo2.theme :as theme]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
(ns quo2.components.navigation.page-nav
|
(ns quo2.components.navigation.page-nav
|
||||||
(:require [clojure.string :as string]
|
(:require [clojure.string :as string]
|
||||||
[quo2.components.avatars.user-avatar :as user-avatar]
|
[quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||||
[quo2.components.buttons.button :as button]
|
[quo2.components.buttons.button :as button]
|
||||||
[quo2.components.icon :as icons]
|
[quo2.components.icon :as icons]
|
||||||
[quo2.components.markdown.text :as text]
|
[quo2.components.markdown.text :as text]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
(:require
|
(:require
|
||||||
[quo2.components.profile.profile-card.style :as style]
|
[quo2.components.profile.profile-card.style :as style]
|
||||||
[quo2.foundations.colors :as colors]
|
[quo2.foundations.colors :as colors]
|
||||||
[quo2.components.avatars.user-avatar :as user-avatar]
|
[quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||||
[quo2.components.icon :as icon]
|
[quo2.components.icon :as icon]
|
||||||
[quo2.components.markdown.text :as text]
|
[quo2.components.markdown.text :as text]
|
||||||
[quo2.components.buttons.button :as button]
|
[quo2.components.buttons.button :as button]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
[quo2.components.profile.select-profile.style :as style]
|
[quo2.components.profile.select-profile.style :as style]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[quo2.components.markdown.text :as text]
|
[quo2.components.markdown.text :as text]
|
||||||
[quo2.components.avatars.user-avatar :as user-avatar]
|
[quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||||
[reagent.core :as reagent]))
|
[reagent.core :as reagent]))
|
||||||
|
|
||||||
(defn- on-change-handler
|
(defn- on-change-handler
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@
|
|||||||
quo2.components.avatars.channel-avatar
|
quo2.components.avatars.channel-avatar
|
||||||
quo2.components.avatars.group-avatar
|
quo2.components.avatars.group-avatar
|
||||||
quo2.components.avatars.icon-avatar
|
quo2.components.avatars.icon-avatar
|
||||||
quo2.components.avatars.user-avatar
|
quo2.components.avatars.user-avatar.view
|
||||||
quo2.components.avatars.wallet-user-avatar
|
quo2.components.avatars.wallet-user-avatar
|
||||||
quo2.components.banners.banner.view
|
quo2.components.banners.banner.view
|
||||||
quo2.components.buttons.button
|
quo2.components.buttons.button
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
(def channel-avatar quo2.components.avatars.channel-avatar/channel-avatar)
|
(def channel-avatar quo2.components.avatars.channel-avatar/channel-avatar)
|
||||||
(def group-avatar quo2.components.avatars.group-avatar/group-avatar)
|
(def group-avatar quo2.components.avatars.group-avatar/group-avatar)
|
||||||
(def icon-avatar quo2.components.avatars.icon-avatar/icon-avatar)
|
(def icon-avatar quo2.components.avatars.icon-avatar/icon-avatar)
|
||||||
(def user-avatar quo2.components.avatars.user-avatar/user-avatar)
|
(def user-avatar quo2.components.avatars.user-avatar.view/user-avatar)
|
||||||
(def wallet-user-avatar quo2.components.avatars.wallet-user-avatar/wallet-user-avatar)
|
(def wallet-user-avatar quo2.components.avatars.wallet-user-avatar/wallet-user-avatar)
|
||||||
|
|
||||||
;;;; BANNER
|
;;;; BANNER
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
(ns quo2.core-spec
|
(ns quo2.core-spec
|
||||||
(:require [quo2.components.banners.banner.component-spec]
|
(:require [quo2.components.avatars.user-avatar.component-spec]
|
||||||
|
[quo2.components.banners.banner.component-spec]
|
||||||
[quo2.components.buttons.--tests--.buttons-component-spec]
|
[quo2.components.buttons.--tests--.buttons-component-spec]
|
||||||
[quo2.components.counter.--tests--.counter-component-spec]
|
[quo2.components.counter.--tests--.counter-component-spec]
|
||||||
[quo2.components.dividers.--tests--.divider-label-component-spec]
|
[quo2.components.dividers.--tests--.divider-label-component-spec]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
(ns status-im2.contexts.quo-preview.avatars.user-avatar
|
(ns status-im2.contexts.quo-preview.avatars.user-avatar
|
||||||
(:require [quo2.components.avatars.user-avatar :as quo2]
|
(:require [quo2.components.avatars.user-avatar.view :as quo2]
|
||||||
[quo2.foundations.colors :as colors]
|
[quo2.foundations.colors :as colors]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
|
|||||||
@@ -30,10 +30,18 @@
|
|||||||
[text]
|
[text]
|
||||||
(rtl/screen.getByText text))
|
(rtl/screen.getByText text))
|
||||||
|
|
||||||
|
(defn find-by-text
|
||||||
|
[text]
|
||||||
|
(rtl/screen.findByText text))
|
||||||
|
|
||||||
(defn get-by-label-text
|
(defn get-by-label-text
|
||||||
[label]
|
[label]
|
||||||
(rtl/screen.getByLabelText (name label)))
|
(rtl/screen.getByLabelText (name label)))
|
||||||
|
|
||||||
|
(defn query-by-label-text
|
||||||
|
[label]
|
||||||
|
(rtl/screen.queryByLabelText (name label)))
|
||||||
|
|
||||||
(defn get-by-translation-text
|
(defn get-by-translation-text
|
||||||
[keyword]
|
[keyword]
|
||||||
(get-by-text (str "tx:" (name keyword))))
|
(get-by-text (str "tx:" (name keyword))))
|
||||||
|
|||||||
Reference in New Issue
Block a user