Revert "Input text styling" (6a9c8de0e4).

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Igor Mandrigin 2018-06-18 10:47:34 +02:00
parent bbdb90fdf6
commit 424d7cc6ae
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
6 changed files with 20 additions and 15 deletions

View File

@ -17,6 +17,7 @@
[status-im.chat.views.message.options :as message-options] [status-im.chat.views.message.options :as message-options]
[status-im.chat.views.message.datemark :as message-datemark] [status-im.chat.views.message.datemark :as message-datemark]
[status-im.chat.views.message.message :as message] [status-im.chat.views.message.message :as message]
[status-im.chat.views.input.input :as input]
[status-im.chat.views.toolbar-content :as toolbar-content] [status-im.chat.views.toolbar-content :as toolbar-content]
[status-im.ui.components.animation :as animation] [status-im.ui.components.animation :as animation]
[status-im.ui.components.list.views :as list] [status-im.ui.components.list.views :as list]

View File

@ -1,6 +1,7 @@
(ns status-im.chat.styles.animations (ns status-im.chat.styles.animations
(:require [status-im.ui.components.styles :as common])) (:require [status-im.ui.components.styles :as common]))
(def color-root-border "rgba(192, 198, 202, 0.28)")
(def header-draggable-icon "rgba(73, 84, 93, 0.23)") (def header-draggable-icon "rgba(73, 84, 93, 0.23)")
(def overlap-container (def overlap-container
@ -17,6 +18,8 @@
:right 0 :right 0
:bottom bottom :bottom bottom
:position :absolute :position :absolute
:border-top-color color-root-border
:border-top-width 1
:elevation 2 :elevation 2
:max-height max-height}) :max-height max-height})

View File

@ -5,12 +5,14 @@
(def min-input-height 36) (def min-input-height 36)
(def padding-vertical 8) (def padding-vertical 8)
(def border-height 1) (def border-height 1)
(def max-input-height (* 5 min-input-height)) (def max-input-height (* 4 min-input-height))
(defnstyle root [margin-bottom] (defnstyle root [margin-bottom]
{:background-color colors/white {:background-color colors/white
:margin-bottom margin-bottom :margin-bottom margin-bottom
:flex-direction :column :flex-direction :column
:border-top-width border-height
:border-top-color colors/gray-light
:elevation 2}) :elevation 2})
(def input-container (def input-container
@ -23,24 +25,21 @@
:padding-bottom padding-vertical :padding-bottom padding-vertical
:flex 1}) :flex 1})
(def input-animated (defn input-animated [content-height]
{:align-items :flex-start {:align-items :flex-start
:flex-direction :row :flex-direction :row
:flex-grow 1 :flex-grow 1
:min-height min-input-height :height (min (max min-input-height content-height) max-input-height)})
:max-height max-input-height})
(defnstyle input-view [single-line-input?] (defnstyle input-view [content-height single-line-input?]
{:flex 1 {:flex 1
:font-size 15 :font-size 15
:line-height 22
:padding-top 9 :padding-top 9
:padding-bottom 5 :padding-bottom 5
:padding-right 12 :padding-right 12
:min-height min-input-height :height (if single-line-input?
:max-height (if single-line-input?
min-input-height min-input-height
max-input-height) (+ (min (max min-input-height content-height) max-input-height)))
:android {:padding-top 3}}) :android {:padding-top 3}})
(def invisible-input-text (def invisible-input-text

View File

@ -4,5 +4,6 @@
(def root (def root
{:background-color common/color-white {:background-color common/color-white
:border-bottom-color colors/gray-light :border-top-color colors/gray-light
:border-bottom-width 1}) :border-top-width 1})

View File

@ -16,9 +16,10 @@
{:flex-direction :row {:flex-direction :row
:align-items :center :align-items :center
:height item-height :height item-height
:padding-horizontal 14 :margin-left 14
:padding-right 14
:border-bottom-color colors/gray-light :border-bottom-color colors/gray-light
:border-bottom-width border-height}) :border-bottom-width (if last? 0 border-height)})
(def item-suggestion-name (def item-suggestion-name
{:color common/color-black {:color common/color-black

View File

@ -70,7 +70,7 @@
(.-selection)) (.-selection))
end (.-end s)] end (.-end s)]
(re-frame/dispatch [:update-text-selection end])) (re-frame/dispatch [:update-text-selection end]))
:style (style/input-view single-line-input?) :style (style/input-view height single-line-input?)
:placeholder-text-color colors/gray :placeholder-text-color colors/gray
:auto-capitalize :sentences} :auto-capitalize :sentences}
(when cooldown-enabled? (when cooldown-enabled?
@ -151,7 +151,7 @@
set-container-width-fn #(reagent/set-state component {:container-width %}) set-container-width-fn #(reagent/set-state component {:container-width %})
{:keys [width height container-width]} (reagent/state component)] {:keys [width height container-width]} (reagent/state component)]
[react/view {:style style/input-root} [react/view {:style style/input-root}
[react/animated-view {:style style/input-animated} [react/animated-view {:style (style/input-animated height)}
[invisible-input {:set-layout-width-fn set-layout-width-fn}] [invisible-input {:set-layout-width-fn set-layout-width-fn}]
[invisible-input-height {:set-layout-height-fn set-layout-height-fn [invisible-input-height {:set-layout-height-fn set-layout-height-fn
:container-width container-width}] :container-width container-width}]