adapt animation & cleanup
This commit is contained in:
parent
831132ccef
commit
d07688136f
|
@ -1,11 +1,9 @@
|
|||
(ns status-im.chat.handlers.animation
|
||||
(:require [re-frame.core :refer [register-handler after dispatch debug]]
|
||||
[re-frame.middleware :refer [path]]
|
||||
[status-im.models.commands :as commands]
|
||||
[status-im.handlers.content-suggestions :refer [get-content-suggestions]]
|
||||
[status-im.chat.constants :refer [input-height request-info-height
|
||||
response-height-normal minimum-suggestion-height]]
|
||||
[status-im.chat.styles.response-suggestions :as response-suggestions-styles]
|
||||
[status-im.constants :refer [response-input-hiding-duration]]))
|
||||
|
||||
;; todo magic value
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
(ns status-im.chat.styles.response-suggestions
|
||||
(:require [status-im.components.styles :refer [font
|
||||
font-medium
|
||||
color-light-blue-transparent
|
||||
color-white
|
||||
color-black
|
||||
color-blue
|
||||
color-blue-transparent
|
||||
selected-message-color
|
||||
online-color
|
||||
separator-color
|
||||
text1-color
|
||||
text2-color
|
||||
text3-color]]))
|
||||
|
||||
(def header-height 50)
|
||||
(def suggestion-height 56)
|
||||
|
||||
(def header-container
|
||||
{:paddingLeft 16
|
||||
:height header-height
|
||||
:backgroundColor color-white})
|
||||
|
||||
(def header-text
|
||||
{:marginTop 18
|
||||
:fontSize 13
|
||||
:fontFamily font-medium
|
||||
:color text2-color})
|
||||
|
||||
(def suggestion-container
|
||||
{:flexDirection :column
|
||||
:paddingLeft 16
|
||||
:height suggestion-height
|
||||
:backgroundColor color-white})
|
||||
|
||||
(def suggestion-sub-container
|
||||
{:height suggestion-height
|
||||
:borderBottomWidth 1
|
||||
:borderBottomColor separator-color})
|
||||
|
||||
(def value-text
|
||||
{:marginTop 10
|
||||
:fontSize 12
|
||||
:fontFamily font
|
||||
:color text1-color})
|
||||
|
||||
(def description-text
|
||||
{:marginTop 2
|
||||
:fontSize 12
|
||||
:fontFamily font
|
||||
:color text2-color})
|
||||
|
||||
(def suggestions-container
|
||||
{:flexDirection :row
|
||||
:flex 1
|
||||
:marginVertical 1
|
||||
:marginHorizontal 0
|
||||
:backgroundColor color-white
|
||||
:borderRadius 5})
|
|
@ -11,7 +11,6 @@
|
|||
text-input
|
||||
touchable-highlight]]
|
||||
[status-im.components.drag-drop :as drag]
|
||||
[status-im.chat.views.response-suggestions :refer [response-suggestions-view]]
|
||||
[status-im.chat.styles.response :as st]
|
||||
[status-im.components.animation :as anim]
|
||||
[status-im.components.react :as react]))
|
||||
|
@ -107,8 +106,18 @@
|
|||
(into [animated-view {:style (st/response-view response-height)}]
|
||||
children))})))
|
||||
|
||||
(defview placeholder []
|
||||
[suggestions [:get-content-suggestions]]
|
||||
(when (seq suggestions)
|
||||
[view st/input-placeholder]))
|
||||
|
||||
(defview response-suggestions-view []
|
||||
[suggestions [:get-content-suggestions]]
|
||||
(when (seq suggestions) suggestions))
|
||||
|
||||
(defn response-view []
|
||||
(let [response-height (anim/create-value 0)]
|
||||
[container response-height
|
||||
[request-info response-height]
|
||||
[response-suggestions-view]]))
|
||||
[response-suggestions-view]
|
||||
[placeholder]]))
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
(ns status-im.chat.views.response-suggestions
|
||||
(:require-macros [status-im.utils.views :refer [defview]])
|
||||
(:require [re-frame.core :refer [subscribe dispatch]]))
|
||||
|
||||
(defview response-suggestions-view []
|
||||
[suggestions [:get-content-suggestions]]
|
||||
(when (seq suggestions) suggestions))
|
Loading…
Reference in New Issue