|
3 | 3 | [quo2.foundations.colors :as colors]
|
4 | 4 | [status-im.ui.components.icons.icons :as icons]))
|
5 | 5 |
|
| 6 | +(def themes {:light {:primary {:icon-color colors/primary-50 |
| 7 | + :background-color colors/primary-20} |
| 8 | + :purple {:icon-color colors/purple-opa-50 |
| 9 | + :background-color colors/purple-opa-20} |
| 10 | + :indigo {:icon-color colors/indigo-opa-50 |
| 11 | + :background-color colors/indigo-opa-20} |
| 12 | + :turquoise {:icon-color colors/turquoise-opa-50 |
| 13 | + :background-color colors/turquoise-opa-20} |
| 14 | + :blue {:icon-color colors/blue-opa-50 |
| 15 | + :background-color colors/blue-opa-20} |
| 16 | + :green {:icon-color colors/green-opa-50 |
| 17 | + :background-color colors/green-opa-20} |
| 18 | + :yellow {:icon-color colors/yellow-opa-50 |
| 19 | + :background-color colors/yellow-opa-20} |
| 20 | + :orange {:icon-color colors/orange-opa-50 |
| 21 | + :background-color colors/orange-opa-20} |
| 22 | + :red {:icon-color colors/red-opa-50 |
| 23 | + :background-color colors/red-opa-20} |
| 24 | + :pink {:icon-color colors/pink-opa-50 |
| 25 | + :background-color colors/pink-opa-20} |
| 26 | + :brown {:icon-color colors/brown-opa-50 |
| 27 | + :background-color colors/brown-opa-20} |
| 28 | + :beige {:icon-color colors/beige-opa-50 |
| 29 | + :background-color colors/beige-opa-20}} |
| 30 | + :dark {:primary {:icon-color colors/primary-60 |
| 31 | + :background-color colors/primary-20} |
| 32 | + :purple {:icon-color colors/purple-opa-60 |
| 33 | + :background-color colors/purple-opa-20} |
| 34 | + :indigo {:icon-color colors/indigo-opa-60 |
| 35 | + :background-color colors/indigo-opa-20} |
| 36 | + :turquoise {:icon-color colors/turquoise-opa-60 |
| 37 | + :background-color colors/turquoise-opa-20} |
| 38 | + :blue {:icon-color colors/blue-opa-60 |
| 39 | + :background-color colors/blue-opa-20} |
| 40 | + :green {:icon-color colors/green-opa-60 |
| 41 | + :background-color colors/green-opa-20} |
| 42 | + :yellow {:icon-color colors/yellow-opa-60 |
| 43 | + :background-color colors/yellow-opa-20} |
| 44 | + :orange {:icon-color colors/orange-opa-60 |
| 45 | + :background-color colors/orange-opa-20} |
| 46 | + :red {:icon-color colors/red-opa-60 |
| 47 | + :background-color colors/red-opa-20} |
| 48 | + :pink {:icon-color colors/pink-opa-60 |
| 49 | + :background-color colors/pink-opa-20} |
| 50 | + :brown {:icon-color colors/brown-opa-60 |
| 51 | + :background-color colors/brown-opa-20} |
| 52 | + :beige {:icon-color colors/beige-opa-60 |
| 53 | + :background-color colors/beige-opa-20}}}) |
| 54 | + |
6 | 55 | (def sizes
|
7 | 56 | {:big 48
|
8 | 57 | :medium 32
|
9 | 58 | :small 20})
|
10 | 59 |
|
11 | 60 | (defn icon-avatar
|
12 |
| - [{:keys [size]}] |
| 61 | + [{:keys [size color dark?]}] |
13 | 62 | (let [component-size (size sizes)
|
| 63 | + is-theme-dark? (if dark? :dark :light) |
| 64 | + circle-color (get-in themes [is-theme-dark? color :background-color]) |
| 65 | + icon-color (get-in themes [is-theme-dark? color :icon-color]) |
14 | 66 | icon-size (case size
|
15 | 67 | :big 20
|
16 | 68 | :medium 16
|
17 | 69 | :small 12)]
|
18 | 70 | [rn/view {:style {:width component-size
|
19 | 71 | :height component-size
|
20 | 72 | :border-radius component-size
|
21 |
| - :background-color colors/primary-50-opa-20 |
| 73 | + :background-color circle-color |
22 | 74 | :justify-content :center
|
23 | 75 | :align-items :center}}
|
24 | 76 | [icons/icon :main-icons/placeholder20 {:container-style {:width icon-size
|
25 | 77 | :height icon-size}
|
26 |
| - :color "nil"}]])) |
| 78 | + :color icon-color}]])) |
0 commit comments