|
9 | 9 | [status-im2.constants :as constant]
|
10 | 10 | [status-im2.contexts.chat.composer.constants :as constants]
|
11 | 11 | [status-im2.contexts.chat.composer.reply.style :as style]
|
| 12 | + [status-im2.contexts.chat.composer.utils :as utils] |
12 | 13 | [utils.ens.stateofus :as stateofus]
|
13 | 14 | [utils.i18n :as i18n]
|
14 | 15 | [utils.re-frame :as rf]))
|
|
85 | 86 | (defn quoted-message
|
86 | 87 | [{:keys [from content-type contentType parsed-text content deleted? deleted-for-me?
|
87 | 88 | album-images-count]}
|
88 |
| - in-chat-input? pin? recording-audio?] |
| 89 | + in-chat-input? pin? recording-audio? input-ref] |
89 | 90 | (let [[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity from])
|
90 | 91 | current-public-key (rf/sub [:multiaccount/public-key])
|
91 | 92 | content-type (or content-type contentType)
|
|
136 | 137 | {:icon-only? true
|
137 | 138 | :size 24
|
138 | 139 | :accessibility-label :reply-cancel-button
|
139 |
| - :on-press #(rf/dispatch [:chat.ui/cancel-message-reply]) |
| 140 | + :on-press #(utils/cancel-reply-message input-ref) |
140 | 141 | :type :outline}
|
141 | 142 | :i/close])
|
142 | 143 | (when (and in-chat-input? recording-audio?)
|
|
148 | 149 | :style style/gradient}])]))
|
149 | 150 |
|
150 | 151 | (defn- f-view
|
151 |
| - [recording?] |
| 152 | + [recording? input-ref] |
152 | 153 | (let [reply (rf/sub [:chats/reply-message])
|
153 | 154 | height (reanimated/use-shared-value (if reply constants/reply-container-height 0))]
|
154 | 155 | (rn/use-effect #(reanimated/animate height (if reply constants/reply-container-height 0)) [reply])
|
155 | 156 | [reanimated/view {:style (reanimated/apply-animations-to-style {:height height} {})}
|
156 |
| - (when reply [quoted-message reply true false recording?])])) |
| 157 | + (when reply [quoted-message reply true false recording? input-ref])])) |
157 | 158 |
|
158 | 159 | (defn view
|
159 |
| - [{:keys [recording?]}] |
160 |
| - [:f> f-view @recording?]) |
| 160 | + [{:keys [recording?]} input-ref] |
| 161 | + [:f> f-view @recording? input-ref]) |
0 commit comments