From c6721dcdfc745991d5196d5b396c06ebe167bdaf Mon Sep 17 00:00:00 2001 From: yenda Date: Wed, 27 Feb 2019 16:50:13 +0100 Subject: [PATCH] fix arrow alignment Signed-off-by: yenda --- .../ui/screens/chat/input/send_button.cljs | 33 ++++++------------- .../chat/styles/input/send_button.cljs | 11 ++----- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/src/status_im/ui/screens/chat/input/send_button.cljs b/src/status_im/ui/screens/chat/input/send_button.cljs index 12773b9c53..684b17b66f 100644 --- a/src/status_im/ui/screens/chat/input/send_button.cljs +++ b/src/status_im/ui/screens/chat/input/send_button.cljs @@ -3,16 +3,8 @@ (:require [clojure.string :as string] [re-frame.core :as re-frame] [status-im.ui.screens.chat.styles.input.send-button :as style] - [status-im.ui.components.animation :as animation] [status-im.ui.components.react :as react] - [status-im.ui.components.icons.vector-icons :as vi])) - -(defn send-button-view-on-update [{:keys [spin-value command-completion]}] - (fn [_] - (let [to-spin-value (if (#{:complete :no-command} command-completion) 1 0)] - (animation/start - (animation/timing spin-value {:toValue to-spin-value - :duration 300}))))) + [status-im.ui.components.icons.vector-icons :as vector-icons])) (defn sendable? [input-text disconnected? login-processing?] (let [trimmed (string/trim input-text)] @@ -22,21 +14,16 @@ disconnected?)))) (defview send-button-view [] - (letsubs [{:keys [command-completion]} [:chats/selected-chat-command] + (letsubs [{:keys [command-completion]} [:chats/selected-chat-command] {:keys [input-text seq-arg-input-text]} [:chats/current-chat] - disconnected? [:disconnected?] - login-processing? [:get-in [:accounts/login :processing]] - spin-value (animation/create-value 1)] - {:component-did-update (send-button-view-on-update {:spin-value spin-value - :command-completion command-completion})} + disconnected? [:disconnected?] + login-processing? [:get-in [:accounts/login :processing]]] (when (and (sendable? input-text disconnected? login-processing?) (or (not command-completion) (#{:complete :less-than-needed} command-completion))) - [react/touchable-highlight {:on-press #(re-frame/dispatch [:chat.ui/send-current-message])} - (let [spin (.interpolate spin-value (clj->js {:inputRange [0 1] - :outputRange ["0deg" "90deg"]}))] - [react/animated-view - {:style (style/send-message-container spin) - :accessibility-label :send-message-button} - [vi/icon :main-icons/arrow-up {:container-style style/send-message-icon - :color :white}]])]))) + [react/touchable-highlight + {:on-press #(re-frame/dispatch [:chat.ui/send-current-message])} + [vector-icons/icon :main-icons/arrow-up + {:container-style style/send-message-container + :accessibility-label :send-message-button + :color :white}]]))) diff --git a/src/status_im/ui/screens/chat/styles/input/send_button.cljs b/src/status_im/ui/screens/chat/styles/input/send_button.cljs index 03d55eb038..b0fb8dff43 100644 --- a/src/status_im/ui/screens/chat/styles/input/send_button.cljs +++ b/src/status_im/ui/screens/chat/styles/input/send_button.cljs @@ -1,17 +1,12 @@ (ns status-im.ui.screens.chat.styles.input.send-button (:require [status-im.ui.components.colors :as colors])) -(defn send-message-container [rotation] +(def send-message-container {:background-color colors/blue :width 30 :height 30 + :padding 3 :border-radius 15 :margin 10 - :padding 4 :margin-left 8 - :margin-bottom 11 - :transform [{:rotate rotation}]}) - -(def send-message-icon - {:height 22 - :width 22}) + :margin-bottom 11})