-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d1812c
commit 8f62a60
Showing
8 changed files
with
66 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
(ns status-im.ui.screens.chat.extensions.views | ||
(:require-macros [status-im.utils.views :as views]) | ||
(:require [status-im.ui.components.react :as react] | ||
[re-frame.core :as re-frame] | ||
[status-im.utils.platform :as platform] | ||
[status-im.ui.components.colors :as colors] | ||
[status-im.ui.components.icons.vector-icons :as vector-icons] | ||
[status-im.ui.components.animation :as anim])) | ||
|
||
(def panel-height 270) | ||
|
||
(defn button [showing?] | ||
[react/touchable-highlight | ||
{:on-press (fn [_] | ||
(re-frame/dispatch [:chat.ui/set-chat-ui-props {:input-bottom-sheet (when-not showing? :extensions)}]) | ||
(when-not platform/desktop? (js/setTimeout #(react/dismiss-keyboard!) 100))) | ||
:accessibility-label :show-extensions-icon} | ||
[vector-icons/icon :main-icons/add {:container-style {:margin 14 :margin-right 6} | ||
:color (if showing? colors/blue colors/gray)}]]) | ||
|
||
(defn show-panel-anim | ||
[bottom-anim-value alpha-value] | ||
(anim/start | ||
(anim/parallel | ||
[(anim/spring bottom-anim-value {:toValue 0 | ||
:useNativeDriver true}) | ||
(anim/timing alpha-value {:toValue 1 | ||
:duration 500 | ||
:useNativeDriver true})]))) | ||
|
||
(views/defview extensions-view [] | ||
(views/letsubs [bottom-anim-value (anim/create-value panel-height) | ||
alpha-value (anim/create-value 0)] | ||
{:component-did-mount #(show-panel-anim bottom-anim-value alpha-value)} | ||
[react/animated-view {:style {:background-color :white | ||
:height panel-height | ||
:transform [{:translateY bottom-anim-value}] | ||
:opacity alpha-value}} | ||
[react/view {:width 127 :height 127 :align-items :center :justify-content :center | ||
:background-color (colors/alpha "#887AF9" 0.2) :border-radius 16 :margin-left 8} | ||
[react/text "Send transaction"]]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters