|
184 | 184 | {:customization-color color
|
185 | 185 | :size :size-32}]))
|
186 | 186 |
|
| 187 | +(defn- notification-layout |
| 188 | + [child] |
| 189 | + [rn/view |
| 190 | + {:style style/notification-container-layout} |
| 191 | + [rn/view {:style style/notification-container} |
| 192 | + child]]) |
| 193 | + |
187 | 194 | (defn notification
|
188 | 195 | [{:keys [muted group-chat unviewed-messages-count unviewed-mentions-count]}]
|
189 | 196 | (let [customization-color (rf/sub [:profile/customization-color])
|
190 | 197 | unread-messages? (pos? unviewed-messages-count)
|
191 | 198 | unread-mentions? (pos? unviewed-mentions-count)]
|
192 |
| - [rn/view {:style style/notification-container} |
193 |
| - (cond |
194 |
| - muted |
195 |
| - [quo/icon :i/muted {:color colors/neutral-40}] |
| 199 | + (cond |
| 200 | + muted |
| 201 | + [notification-layout |
| 202 | + [quo/icon :i/muted {:color colors/neutral-40}]] |
196 | 203 |
|
197 |
| - (and group-chat unread-mentions?) |
| 204 | + (and group-chat unread-mentions?) |
| 205 | + [notification-layout |
198 | 206 | [quo/counter
|
199 | 207 | {:container-style {:position :relative :right 0}
|
200 | 208 | :customization-color customization-color
|
201 | 209 | :accessibility-label :new-message-counter}
|
202 |
| - unviewed-mentions-count] |
| 210 | + unviewed-mentions-count]] |
203 | 211 |
|
204 |
| - ;; TODO: use the grey-dot component when chat-list-item is moved to quo.components |
205 |
| - (and group-chat unread-messages?) |
| 212 | + ;; TODO: use the grey-dot component when chat-list-item is moved to quo.components |
| 213 | + (and group-chat unread-messages?) |
| 214 | + [notification-layout |
206 | 215 | [rn/view
|
207 | 216 | {:style (style/grey-dot)
|
208 |
| - :accessibility-label :unviewed-messages-public}] |
| 217 | + :accessibility-label :unviewed-messages-public}]] |
209 | 218 |
|
210 |
| - unread-messages? |
| 219 | + unread-messages? |
| 220 | + [notification-layout |
211 | 221 | [quo/counter
|
212 | 222 | {:container-style {:position :relative :right 0}
|
213 | 223 | :customization-color customization-color
|
214 | 224 | :accessibility-label :new-message-counter}
|
215 |
| - unviewed-messages-count])])) |
| 225 | + unviewed-messages-count]]))) |
216 | 226 |
|
217 | 227 | (defn chat-item
|
218 | 228 | [{:keys [chat-id group-chat color name last-message timestamp muted]
|
|
223 | 233 | (rf/sub [:contacts/contact-two-names-by-identity chat-id]))
|
224 | 234 | {:keys [ens-verified added?] :as contact} (when-not group-chat
|
225 | 235 | (rf/sub [:contacts/contact-by-address chat-id]))]
|
226 |
| - [:<> |
| 236 | + [rn/view {:style {:flex-direction :row}} |
227 | 237 | [avatar-view
|
228 | 238 | {:contact contact
|
229 | 239 | :chat-id chat-id
|
230 | 240 | :full-name primary-name
|
231 | 241 | :color color
|
232 | 242 | :muted? muted}]
|
233 |
| - [rn/view {:style style/chat-data-container} |
234 |
| - [quo/author |
235 |
| - {:primary-name primary-name |
236 |
| - :secondary-name secondary-name |
237 |
| - :size 15 |
238 |
| - :verified? ens-verified |
239 |
| - :contact? added? |
240 |
| - :muted? muted |
241 |
| - :time-str (datetime/to-short-str timestamp)}] |
242 |
| - [last-message-preview group-chat last-message muted]] |
| 243 | + [rn/view {:style {:flex-shrink 1}} |
| 244 | + [rn/view {:style style/chat-data-container} |
| 245 | + [quo/author |
| 246 | + {:primary-name primary-name |
| 247 | + :secondary-name secondary-name |
| 248 | + :size 15 |
| 249 | + :verified? ens-verified |
| 250 | + :contact? added? |
| 251 | + :muted? muted |
| 252 | + :time-str (datetime/to-short-str timestamp) |
| 253 | + :style {:flex-shrink 1}}] |
| 254 | + [last-message-preview group-chat last-message muted]]] |
243 | 255 | [notification item]]))
|
244 | 256 |
|
245 | 257 | (defn chat-user
|
|
0 commit comments