commands button

Former-commit-id: e728c155a1
This commit is contained in:
Roman Volosovskyi 2016-06-30 11:48:56 +03:00
parent 0ce1e18581
commit b763d5d9c9
7 changed files with 40 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

View File

@ -9,11 +9,24 @@
:justifyContent :center}) :justifyContent :center})
(defn message-input-button [scale] (defn message-input-button [scale]
{:transform [{:scale scale}]}) {:transform [{:scale scale}]
:width 24
:height 24
:alignItems :center
:justifyContent :center})
(def list-icon (def list-icon
{:width 13 {:width 16
:height 12}) :height 16})
(def requests-icon
{:background-color :#7099e6
:width 8
:height 8
:border-radius 8
:left 0
:top 0
:position :absolute})
(def close-icon (def close-icon
{:width 12 {:width 12

View File

@ -5,6 +5,7 @@
[status-im.components.react :refer [view [status-im.components.react :refer [view
animated-view animated-view
icon icon
text
touchable-highlight]] touchable-highlight]]
[status-im.components.animation :as anim] [status-im.components.animation :as anim]
[status-im.chat.styles.plain-message :as st] [status-im.chat.styles.plain-message :as st]
@ -38,6 +39,8 @@
(defn commands-button [] (defn commands-button []
(let [command? (subscribe [:command?]) (let [command? (subscribe [:command?])
requests (subscribe [:get-requests])
suggestions (subscribe [:get-suggestions])
buttons-scale (anim/create-value (if @command? 1 0)) buttons-scale (anim/create-value (if @command? 1 0))
container-width (anim/create-value (if @command? 20 56)) container-width (anim/create-value (if @command? 20 56))
context {:command? command? context {:command? command?
@ -58,7 +61,12 @@
[animated-view {:style (st/message-input-button-touchable [animated-view {:style (st/message-input-button-touchable
container-width)} container-width)}
[animated-view {:style (st/message-input-button buttons-scale)} [animated-view {:style (st/message-input-button buttons-scale)}
[icon :list st/list-icon]]]])}))) (if (seq @suggestions)
[icon :close_gray st/close-icon]
[icon :input_list st/list-icon])
(when (and (seq @requests)
(not (seq @suggestions)))
[view st/requests-icon])]]])})))
(defn smile-animation-logic [{:keys [command? val width]}] (defn smile-animation-logic [{:keys [command? val width]}]
(fn [_] (fn [_]