[#14877] No ability to type the text into textbox if image is added [#14881] Input field is hidden in composer (#14911)

This commit is contained in:
flexsurfer 2023-01-27 16:40:04 +01:00 committed by GitHub
parent 85fc754104
commit 6002672e7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 24 deletions

View File

@ -1,6 +1,5 @@
(ns quo2.components.record-audio.record-audio.buttons.record-button-big (ns quo2.components.record-audio.record-audio.buttons.record-button-big
(:require [quo.react :refer [memo]] (:require [quo2.components.icon :as icons]
[quo2.components.icon :as icons]
[quo2.components.record-audio.record-audio.style :as style] [quo2.components.record-audio.record-audio.style :as style]
[quo2.foundations.colors :as colors] [quo2.foundations.colors :as colors]
[react-native.core :as rn :refer [use-effect]] [react-native.core :as rn :refer [use-effect]]
@ -34,7 +33,7 @@
(def ^:private animated-ring (def ^:private animated-ring
(reagent/adapt-react-class (reagent/adapt-react-class
(memo (rn/memo
(fn [props] (fn [props]
(let [{:keys [scale opacity color]} (bean/bean props)] (let [{:keys [scale opacity color]} (bean/bean props)]
(reagent/as-element (reagent/as-element

View File

@ -1,7 +1,6 @@
(ns quo2.components.record-audio.record-audio.view (ns quo2.components.record-audio.record-audio.view
(:require [cljs-bean.core :as bean] (:require [cljs-bean.core :as bean]
[oops.core :as oops] [oops.core :as oops]
[quo.react :refer [memo]]
[quo2.components.icon :as icons] [quo2.components.icon :as icons]
[quo2.components.record-audio.record-audio.style :as style] [quo2.components.record-audio.record-audio.style :as style]
[quo2.foundations.colors :as colors] [quo2.foundations.colors :as colors]
@ -518,7 +517,7 @@
(def record-audio (def record-audio
(reagent/adapt-react-class (reagent/adapt-react-class
(memo (rn/memo
(fn [props] (fn [props]
(let [{:keys [onStartRecording onReviewingAudio onSend onCancel]} (bean/bean props)] (let [{:keys [onStartRecording onReviewingAudio onSend onCancel]} (bean/bean props)]
(reagent/as-element (reagent/as-element

View File

@ -88,6 +88,8 @@
props)] props)]
children)) children))
(def memo react/memo)
(def create-ref react/createRef) (def create-ref react/createRef)
(def use-ref react/useRef) (def use-ref react/useRef)

View File

@ -118,7 +118,7 @@
[mentions/autocomplete-mentions suggestions (:text-input-ref refs)]]))]) [mentions/autocomplete-mentions suggestions (:text-input-ref refs)]]))])
(defn effect! (defn effect!
[{:keys [keyboard-shown] :as params}] [{:keys [keyboard-shown reply edit suggestions images] :as params}]
(rn/use-effect (rn/use-effect
(fn [] (fn []
(when (or (not @keyboard-hiding?) (when (or (not @keyboard-hiding?)
@ -126,7 +126,8 @@
(reset! keyboard-hiding? false) (reset! keyboard-hiding? false)
(if (not keyboard-shown) (if (not keyboard-shown)
(minimize params) (minimize params)
(update-y params)))))) (update-y params))))
[reply edit suggestions images]))
(defn prepare-params (defn prepare-params
[[refs window-height translate-y bg-opacity bg-bottom min-y max-y parent-height [[refs window-height translate-y bg-opacity bg-bottom min-y max-y parent-height

View File

@ -21,18 +21,18 @@
(fn [] (fn []
(let [shared-element-id (rf/sub [:shared-element-id])] (let [shared-element-id (rf/sub [:shared-element-id])]
[rn/touchable-opacity [rn/touchable-opacity
{:active-opacity 1 {:style {:margin-top (when (> index 0) 20) :width (:width dimensions)}
:style {:margin-top (when (> index 0) 20)} :on-press (fn []
:on-press (fn [] (rf/dispatch [:chat.ui/update-shared-element-id message-id])
(rf/dispatch [:chat.ui/update-shared-element-id message-id]) (js/setTimeout #(rf/dispatch [:chat.ui/navigate-to-horizontal-images
(js/setTimeout #(rf/dispatch [:chat.ui/navigate-to-horizontal-images [message] 0])
[message] 0]) 100))
100)) :on-long-press on-long-press}
:on-long-press on-long-press} [rn/view
;; This text comp is temporary. Should later use ;; This text comp is temporary. Should later use
;; `status-im2.contexts.chat.messages.content.text.view` ;; `status-im2.contexts.chat.messages.content.text.view`
(when (and (not= text "placeholder") (= index 0)) [rn/text text]) (when (and (not= text "placeholder") (= index 0)) [rn/text text])
[rn/image [rn/image
{:source {:uri (:image content)} {:source {:uri (:image content)}
:style (merge dimensions {:border-radius 12}) :style (merge dimensions {:border-radius 12})
:native-ID (when (= shared-element-id message-id) :shared-element)}]])))) :native-ID (when (= shared-element-id message-id) :shared-element)}]]]))))

View File

@ -28,7 +28,9 @@
(let [response-to (:response-to (:content message)) (let [response-to (:response-to (:content message))
default-size 36] default-size 36]
[rn/touchable-opacity [rn/touchable-opacity
{:on-press #(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id]) {:on-press #(do
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id]))
:active-opacity 1 :active-opacity 1
:style (merge {:flex-direction :row :margin-vertical 8} :style (merge {:flex-direction :row :margin-vertical 8}
(old-style/message-wrapper message))} (old-style/message-wrapper message))}

View File

@ -68,6 +68,7 @@
(defn message-on-long-press (defn message-on-long-press
[message-data context] [message-data context]
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:bottom-sheet/show-sheet (rf/dispatch [:bottom-sheet/show-sheet
{:content (drawers/reactions-and-actions message-data context)}])) {:content (drawers/reactions-and-actions message-data context)}]))
@ -79,6 +80,7 @@
[rn/touchable-highlight [rn/touchable-highlight
{:underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90) {:underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90)
:style {:border-radius 16} :style {:border-radius 16}
:on-press #(rf/dispatch [:dismiss-keyboard])
:on-long-press #(message-on-long-press message-data context)} :on-long-press #(message-on-long-press message-data context)}
[rn/view {:padding-vertical 8} [rn/view {:padding-vertical 8}
(when (and (seq response-to) quoted-message) (when (and (seq response-to) quoted-message)

View File

@ -15,6 +15,8 @@
[quo/banner [quo/banner
{:latest-pin-text latest-pin-text {:latest-pin-text latest-pin-text
:pins-count pins-count :pins-count pins-count
:on-press #(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id])}])) :on-press #(do
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:bottom-sheet/show-sheet :pinned-messages-list chat-id]))}]))