From 8d9675154cb6f0cbb426bb3021bfef87a7921c19 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Thu, 22 Feb 2018 10:12:32 +0100 Subject: [PATCH] Increased chat icon tapping area Signed-off-by: Julien Eluard --- src/status_im/chat/styles/input/input.cljs | 11 ++++------- src/status_im/chat/styles/input/send_button.cljs | 3 ++- src/status_im/chat/views/input/input.cljs | 8 ++++---- src/status_im/chat/views/input/send_button.cljs | 5 ++--- src/status_im/ui/screens/profile/events.cljs | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/status_im/chat/styles/input/input.cljs b/src/status_im/chat/styles/input/input.cljs index 530d34d7f3..8e3b3781d3 100644 --- a/src/status_im/chat/styles/input/input.cljs +++ b/src/status_im/chat/styles/input/input.cljs @@ -1,8 +1,6 @@ (ns status-im.chat.styles.input.input (:require-macros [status-im.utils.styles :refer [defstyle defnstyle]]) - (:require [status-im.ui.components.styles :as common] - [status-im.ui.components.colors :as colors] - [status-im.utils.platform :as platform])) + (:require [status-im.ui.components.colors :as colors])) (def min-input-height 36) (def padding-vertical 8) @@ -10,7 +8,7 @@ (def max-input-height (* 4 min-input-height)) (defnstyle root [margin-bottom] - {:background-color common/color-white + {:background-color colors/white :margin-bottom margin-bottom :flex-direction :column :border-top-width border-height @@ -20,8 +18,7 @@ (def input-container {:flex-direction :row :align-items :flex-end - :padding-left 14 - :padding-right 14}) + :padding-left 14}) (def input-root {:padding-top padding-vertical @@ -93,7 +90,7 @@ :left left}}) (def input-commands-icon - {:margin-bottom 14 + {:margin 14 :height 24 :width 24}) diff --git a/src/status_im/chat/styles/input/send_button.cljs b/src/status_im/chat/styles/input/send_button.cljs index c3989fbf68..b0b505a900 100644 --- a/src/status_im/chat/styles/input/send_button.cljs +++ b/src/status_im/chat/styles/input/send_button.cljs @@ -6,6 +6,7 @@ :width 30 :height 30 :border-radius 15 + :margin 10 :padding 4 :margin-left 8 :margin-bottom 11 @@ -13,4 +14,4 @@ (def send-message-icon {:height 22 - :width 22}) \ No newline at end of file + :width 22}) diff --git a/src/status_im/chat/views/input/input.cljs b/src/status_im/chat/views/input/input.cljs index 8dd54ee5b3..436aa41c1e 100644 --- a/src/status_im/chat/views/input/input.cljs +++ b/src/status_im/chat/views/input/input.cljs @@ -113,7 +113,7 @@ arg-pos [:current-chat-argument-position] seq-arg-input-text [:chat :seq-argument-input-text]] (when (get-in command [:command :sequential-params]) - (let [{:keys [placeholder hidden type]} (get-in command [:command :params arg-pos])] + (let [{:keys [placeholder type]} (get-in command [:command :params arg-pos])] [react/text-input (merge {:ref #(re-frame/dispatch [:set-chat-ui-props {:seq-input-ref %}]) :style (style/seq-input-text command-width container-width) :default-value (or seq-arg-input-text "") @@ -174,9 +174,9 @@ (re-frame/dispatch [:set-chat-ui-props {:input-height h}])))} [react/view {:style style/input-container} [input-view {:single-line-input? single-line-input?}] - (when (string/blank? input-text) - [commands-button]) - [send-button/send-button-view]]]))) + (if (string/blank? input-text) + [commands-button] + [send-button/send-button-view])]]))) (defn container [] [react/view diff --git a/src/status_im/chat/views/input/send_button.cljs b/src/status_im/chat/views/input/send_button.cljs index e2c729d173..380d10102e 100644 --- a/src/status_im/chat/views/input/send_button.cljs +++ b/src/status_im/chat/views/input/send_button.cljs @@ -1,7 +1,6 @@ (ns status-im.chat.views.input.send-button (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [clojure.string :as string] - [reagent.core :as reagent] [re-frame.core :as re-frame] [status-im.chat.styles.input.send-button :as style] [status-im.ui.components.animation :as animation] @@ -9,7 +8,7 @@ [status-im.ui.components.icons.vector-icons :as vi] [status-im.utils.utils :as utils])) -(defn send-button-view-on-update [{:keys [spin-value opacity-value command-completion]}] +(defn send-button-view-on-update [{:keys [spin-value command-completion]}] (fn [_] (let [to-spin-value (if (some #{:complete :no-command} [@command-completion]) 1 0)] (animation/start @@ -44,4 +43,4 @@ {:style (style/send-message-container spin) :accessibility-label :send-message-button} [vi/icon :icons/input-send {:container-style style/send-message-icon - :color :white}]])])))) \ No newline at end of file + :color :white}]])])))) diff --git a/src/status_im/ui/screens/profile/events.cljs b/src/status_im/ui/screens/profile/events.cljs index 3e985c5db0..52e01ba74f 100644 --- a/src/status_im/ui/screens/profile/events.cljs +++ b/src/status_im/ui/screens/profile/events.cljs @@ -51,7 +51,7 @@ (handlers/register-handler-fx :my-profile.drawer/edit-name (fn [{:keys [db]} _] - (let [{:my-profile/keys [default-name edit auto-save]} db + (let [{:my-profile/keys [default-name]} db {:keys [name public-key]} (get-current-account db)] {:db (cond-> db (not default-name) (assoc :my-profile/default-name (gfycat/generate-gfy public-key))