-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Connection request and UI of bottom sheet
- Loading branch information
1 parent
90c5b49
commit 9bb5a47
Showing
15 changed files
with
183 additions
and
25 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
131 changes: 131 additions & 0 deletions
131
src/status_im/ui/screens/wallet/wallet_connect/views.cljs
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,131 @@ | ||
(ns status-im.ui.screens.wallet.wallet-connect.views | ||
(:require-macros [status-im.utils.views :refer [defview letsubs]]) | ||
(:require [re-frame.core :as re-frame] | ||
[status-im.ui.components.react :as react] | ||
[status-im.multiaccounts.recover.core :as multiaccounts.recover] | ||
[status-im.keycard.recovery :as keycard] | ||
[status-im.i18n.i18n :as i18n] | ||
[status-im.utils.config :as config] | ||
[status-im.utils.security] | ||
[quo.design-system.colors :as colors] | ||
[quo.core :as quo] | ||
[status-im.ui.components.icons.icons :as icons] | ||
[status-im.react-native.resources :as resources] | ||
[reagent.core :as reagent])) | ||
|
||
(defn hide-sheet-and-dispatch [event] | ||
(re-frame/dispatch [:bottom-sheet/hide]) | ||
(re-frame/dispatch event)) | ||
|
||
(defn circle [{:keys [color size style icon]}] | ||
[react/view | ||
{:style (merge | ||
style | ||
{:width size | ||
:height size | ||
:background-color color | ||
:border-radius (/ size 2) | ||
:align-items :center | ||
:justify-content :center})} | ||
(when icon | ||
[icons/icon icon | ||
{:color colors/blue}])]) | ||
|
||
(defn toolbar-selection [{:keys [icon text background-color multiaccounts]}] | ||
[react/touchable-opacity | ||
[react/view {:style {:height 36 | ||
:min-width 189 | ||
:border-radius 18 | ||
:background-color background-color | ||
:align-items :center | ||
:flex-direction :row | ||
:padding-left 12 | ||
:padding-right 8}} | ||
[icons/icon | ||
:main-icons/billfold | ||
{:color (:text-05 @colors/theme) | ||
:width 18 | ||
:height 17.8}] | ||
[quo/text {:color :inverse | ||
:style {:margin-left 8 | ||
}} | ||
text] | ||
[icons/icon | ||
:main-icons/chevron-down | ||
{:color (:text-05 @colors/theme) | ||
:width 24 | ||
:height 24}]]]) | ||
|
||
(defview bottom-sheet-view [] | ||
(letsubs [view-id [:view-id] | ||
{:keys [name url icons description]} [:wallet-connect/proposal-metadata] | ||
{:keys [address] :as account} [:multiaccount] | ||
accounts [:multiaccount/visible-accounts] | ||
selected-account (reagent/atom nil)] | ||
[react/view {:flex 1 :align-items :center} | ||
[react/view {:flex-direction :row | ||
:align-items :center | ||
:margin-top 10 | ||
:margin-bottom 16} | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 40 | ||
:style {:margin-right 8}}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 4 | ||
:style {:margin-right 4}}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 4 | ||
:style {:margin-right 4}}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 4 | ||
:style {:margin-right 8}}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 24 | ||
:style {:margin-right 8} | ||
:icon :main-icons/checkmark}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 4 | ||
:style {:margin-right 4}}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 4 | ||
:style {:margin-right 4}}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 4 | ||
:style {:margin-right 8}}] | ||
[circle {:color (:interactive-02 @colors/theme) | ||
:size 40}]] | ||
[react/view {:flex 1 | ||
:align-items :center} | ||
[react/view {:style {:flex-direction :row}} | ||
[quo/text {:weight :bold | ||
:size :large} | ||
(str name " ")] | ||
[quo/text {:weight :regular | ||
:size :large | ||
:color :secondary | ||
:style {:margin-bottom 16}} | ||
(i18n/label :t/wallet-connect-proposal-title {:name name})]] | ||
[toolbar-selection {:icon :main-icons/billfold | ||
:background-color (:color (first accounts)) | ||
:text (:name (first accounts)) | ||
:multiaccounts accounts}] | ||
[quo/text {:align :center | ||
:color :secondary | ||
:style {:margin-vertical 16}} | ||
(i18n/label :t/wallet-connect-proposal-description {:name name})] | ||
[react/view {:padding-horizontal 16 :width "100%" :align-items :stretch :justify-content :space-between :flex-direction :row :margin-top 6} | ||
[react/view {:flex 1 | ||
:margin-right 4} | ||
[quo/button | ||
{:on-press #(re-frame/dispatch [:bottom-sheet/hide])} | ||
(i18n/label :t/cancel)]] | ||
[react/view {:flex 1 | ||
:margin-left 4} | ||
[quo/button | ||
{:theme :accent | ||
:on-press #(re-frame/dispatch [:wallet-connect/approve-proposal])} | ||
(i18n/label :t/connect)]] | ||
]]])) | ||
|
||
(def bottom-sheet | ||
{:content bottom-sheet-view}) |
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