|
3 | 3 | [promesa.core :as promesa] |
4 | 4 | [quo.core :as quo] |
5 | 5 | [react-native.core :as rn] |
| 6 | + [react-native.gesture :as gesture] |
6 | 7 | [status-im.contexts.shell.activity-center.notification.common.view :as common] |
7 | 8 | [utils.datetime :as datetime] |
8 | 9 | [utils.i18n :as i18n] |
|
51 | 52 |
|
52 | 53 | (defn view |
53 | 54 | [{:keys [notification extra-fn]}] |
54 | | - (let [customization-color (rf/sub [:profile/customization-color]) |
55 | | - {:keys [news-title news-description timestamp]} notification |
56 | | - timestamp (datetime/timestamp->relative timestamp)] |
| 55 | + (let [customization-color (rf/sub [:profile/customization-color]) |
| 56 | + {:keys [news-title |
| 57 | + news-description |
| 58 | + timestamp]} notification |
| 59 | + timestamp (datetime/timestamp->relative timestamp) |
| 60 | + on-press (rn/use-callback |
| 61 | + #(rf/dispatch [:show-bottom-sheet |
| 62 | + {:theme :dark |
| 63 | + :content (fn [] |
| 64 | + [sheet notification timestamp])}]))] |
57 | 65 | [common/swipeable |
58 | 66 | {:left-button common/swipe-button-read-or-unread |
59 | 67 | :left-on-press common/swipe-on-press-toggle-read |
60 | 68 | :right-button common/swipe-button-delete |
61 | 69 | :right-on-press common/swipe-on-press-delete |
62 | 70 | :extra-fn extra-fn} |
63 | | - [quo/activity-log |
64 | | - {:title news-title |
65 | | - :customization-color customization-color |
66 | | - :icon :i/status-logo-bw |
67 | | - :timestamp timestamp |
68 | | - :context [[quo/text {} news-description]] |
69 | | - :items [{:type :button |
70 | | - :subtype :primary |
71 | | - :key :button-reply |
72 | | - :customization-color customization-color |
73 | | - :label (i18n/label :t/read-more) |
74 | | - :accessibility-label :read-more |
75 | | - :on-press #(rf/dispatch |
76 | | - [:show-bottom-sheet |
77 | | - {:theme :dark |
78 | | - :content |
79 | | - (fn [] |
80 | | - [sheet notification timestamp])}])}]}]])) |
| 71 | + [gesture/touchable-without-feedback |
| 72 | + {:on-press on-press} |
| 73 | + [quo/activity-log |
| 74 | + {:title news-title |
| 75 | + :customization-color customization-color |
| 76 | + :icon :i/status-logo-bw |
| 77 | + :timestamp timestamp |
| 78 | + :context [[quo/text {} news-description]] |
| 79 | + :items [{:type :button |
| 80 | + :subtype :primary |
| 81 | + :key :button-reply |
| 82 | + :customization-color customization-color |
| 83 | + :label (i18n/label :t/read-more) |
| 84 | + :accessibility-label :read-more |
| 85 | + :on-press on-press}]}]]])) |
0 commit comments