refactor toolbar action
This commit is contained in:
parent
998df74b10
commit
17011f6d9e
|
@ -88,15 +88,13 @@
|
||||||
(defn toolbar-action []
|
(defn toolbar-action []
|
||||||
(let [show-actions (subscribe [:chat-ui-props :show-actions?])]
|
(let [show-actions (subscribe [:chat-ui-props :show-actions?])]
|
||||||
(fn []
|
(fn []
|
||||||
(if @show-actions
|
(let [show-actions @show-actions]
|
||||||
[touchable-highlight
|
[touchable-highlight
|
||||||
{:on-press #(dispatch [:set-chat-ui-props {:show-actions? false}])}
|
{:on-press #(dispatch [:set-chat-ui-props {:show-actions? (not show-actions)}])}
|
||||||
[view st/action
|
[view st/action
|
||||||
[vi/icon :icons/dropdown-up]]]
|
(if show-actions
|
||||||
[touchable-highlight
|
[vi/icon :icons/dropdown-up]
|
||||||
{:on-press #(dispatch [:set-chat-ui-props {:show-actions? true}])}
|
[chat-icon])]]))))
|
||||||
[view st/action
|
|
||||||
[chat-icon]]]))))
|
|
||||||
|
|
||||||
(defview add-contact-bar []
|
(defview add-contact-bar []
|
||||||
[chat-id [:get :current-chat-id]
|
[chat-id [:get :current-chat-id]
|
||||||
|
|
Loading…
Reference in New Issue