|
25 | 25 | (if (= stored :on-device) (i18n/label :t/on-device) (i18n/label :t/on-keycard))))
|
26 | 26 |
|
27 | 27 | (defn avatar
|
28 |
| - [type full-name customization-color] |
29 |
| - (if (= type :default-keypair) |
30 |
| - [user-avatar/user-avatar |
31 |
| - {:full-name full-name |
32 |
| - :ring? true |
33 |
| - :size :small |
34 |
| - :customization-color customization-color}] |
35 |
| - [icon-avatar/icon-avatar |
36 |
| - {:size :size/s-32 |
37 |
| - :icon :i/placeholder |
38 |
| - :border? true}])) |
| 28 | + [{:keys [type details customization-color]}] |
| 29 | + (let [{:keys [full-name]} details] |
| 30 | + (if (= type :default-keypair) |
| 31 | + [user-avatar/user-avatar |
| 32 | + {:full-name full-name |
| 33 | + :ring? true |
| 34 | + :size :small |
| 35 | + :customization-color customization-color}] |
| 36 | + [icon-avatar/icon-avatar |
| 37 | + {:size :size/s-32 |
| 38 | + :icon :i/placeholder |
| 39 | + :border? true}]))) |
39 | 40 |
|
40 | 41 | (defn title-view
|
41 |
| - [full-name action selected? type blur? customization-color on-options-press theme] |
42 |
| - [rn/view |
43 |
| - {:style style/title-container |
44 |
| - :accessibility-label :title} |
45 |
| - [text/text {:weight :semi-bold} |
46 |
| - (if (= type :default-keypair) (keypair-string full-name) full-name)] |
47 |
| - (if (= action :selector) |
48 |
| - [selectors/radio |
49 |
| - {:checked? selected? |
50 |
| - :blur? blur? |
51 |
| - :customization-color customization-color}] |
52 |
| - [rn/pressable {:on-press on-options-press} |
53 |
| - [icon/icon :i/options |
54 |
| - {:color (if blur? |
55 |
| - colors/white-opa-70 |
56 |
| - (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)) |
57 |
| - :accessibility-label :options-button}]])]) |
| 42 | + [{:keys [details action selected? type blur? customization-color on-options-press theme]}] |
| 43 | + (let [{:keys [full-name]} details] |
| 44 | + [rn/view |
| 45 | + {:style style/title-container |
| 46 | + :accessibility-label :title} |
| 47 | + [text/text {:weight :semi-bold} |
| 48 | + (if (= type :default-keypair) (keypair-string full-name) full-name)] |
| 49 | + (if (= action :selector) |
| 50 | + [selectors/radio |
| 51 | + {:checked? selected? |
| 52 | + :blur? blur? |
| 53 | + :customization-color customization-color}] |
| 54 | + [rn/pressable {:on-press on-options-press} |
| 55 | + [icon/icon :i/options |
| 56 | + {:color (if blur? |
| 57 | + colors/white-opa-70 |
| 58 | + (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)) |
| 59 | + :accessibility-label :options-button}]])])) |
58 | 60 |
|
59 | 61 | (defn details-view
|
| 62 | +<<<<<<< HEAD |
60 | 63 | [address stored blur? theme]
|
61 | 64 | [rn/view
|
62 | 65 | {:style {:flex-direction :row
|
|
79 | 82 | colors/white-opa-40
|
80 | 83 | (colors/theme-colors colors/neutral-50 colors/neutral-40))}]])])
|
81 | 84 | >>>>>>> be98d71dc (quo2: keypair blur)
|
| 85 | +======= |
| 86 | + [details stored blur? theme] |
| 87 | + (let [{:keys [address]} details] |
| 88 | + [rn/view |
| 89 | + {:style {:flex-direction :row |
| 90 | + :align-items :center}} |
| 91 | + [text/text |
| 92 | + {:size :paragraph-2 |
| 93 | + :accessibility-label :details |
| 94 | + :style {:color (if blur? |
| 95 | + colors/white-opa-40 |
| 96 | + (colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}} |
| 97 | + (details-string address stored)] |
| 98 | + (when (= stored :on-keycard) |
| 99 | + [rn/view {:style {:margin-left 4}} |
| 100 | + [icon/icon :i/keycard-card |
| 101 | + {:size 16 |
| 102 | + :color (if blur? |
| 103 | + colors/white-opa-40 |
| 104 | + (colors/theme-colors colors/neutral-50 colors/neutral-40))}]])])) |
| 105 | +>>>>>>> a52fda25e (lint) |
82 | 106 |
|
83 | 107 | (defn- view-internal
|
84 | 108 | []
|
85 | 109 | (let [selected? (reagent/atom true)]
|
86 |
| - (fn [{:keys [theme accounts customization-color type details stored action blur? on-options-press]}] |
87 |
| - (let [{:keys [address full-name]} details] |
88 |
| - [rn/pressable |
89 |
| - {:style (style/container @selected? blur? customization-color theme) |
90 |
| - :on-press #(when (= action :selector) (reset! selected? (not @selected?)))} |
91 |
| - [rn/view {:style style/header-container} |
92 |
| - [avatar type full-name customization-color] |
93 |
| - [rn/view |
94 |
| - {:style {:margin-left 8 |
95 |
| - :flex 1}} |
96 |
| - [title-view full-name action @selected? type blur? customization-color on-options-press theme] |
97 |
| - [details-view address stored blur? theme]]] |
98 |
| - [rn/flat-list |
99 |
| - {:data accounts |
100 |
| - :render-fn account-list-card/view |
101 |
| - :separator [rn/view {:style {:height 8}}] |
102 |
| - :style {:padding-horizontal 8}}]])))) |
| 110 | + (fn [{:keys [accounts action] :as props}] |
| 111 | + [rn/pressable |
| 112 | + {:style (style/container (merge props {:selected? @selected?})) |
| 113 | + :on-press #(when (= action :selector) (reset! selected? (not @selected?)))} |
| 114 | + [rn/view {:style style/header-container} |
| 115 | + [avatar props] |
| 116 | + [rn/view |
| 117 | + {:style {:margin-left 8 |
| 118 | + :flex 1}} |
| 119 | + [title-view (merge props {:selected? @selected?})] |
| 120 | + [details-view props]]] |
| 121 | + [rn/flat-list |
| 122 | + {:data accounts |
| 123 | + :render-fn account-list-card/view |
| 124 | + :separator [rn/view {:style {:height 8}}] |
| 125 | + :style {:padding-horizontal 8}}]]))) |
103 | 126 |
|
104 | 127 | (def view (quo.theme/with-theme view-internal))
|
105 |
| - |
106 |
| -;; todo: mapize, fix dot |
|
0 commit comments