Skip to content

Commit 198a4d7

Browse files
feat: transaction confirmation page ui (#17812)
Signed-off-by: Brian Sztamfater <[email protected]>
1 parent 3b5fe36 commit 198a4d7

File tree

5 files changed

+248
-2
lines changed

5 files changed

+248
-2
lines changed

src/quo/components/wallet/summary_info/style.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
(defn container
66
[networks? theme]
7-
{:width 335
7+
{:width "100%"
88
:height (if networks? 90 56)
99
:border-radius 16
1010
:border-width 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
(ns status-im2.contexts.wallet.send.transaction-confirmation.style
2+
(:require [quo.foundations.colors :as colors]))
3+
4+
(defn container
5+
[margin-top]
6+
{:position :absolute
7+
:top margin-top
8+
:right 0
9+
:left 0
10+
:bottom 0})
11+
12+
(def content-container
13+
{:padding-top 12
14+
:padding-horizontal 20
15+
:padding-bottom 32})
16+
17+
(def title-container
18+
{:margin-right 4})
19+
20+
(defn details-container
21+
[theme]
22+
{:flex-direction :row
23+
:justify-content :space-between
24+
:height 52
25+
:padding-horizontal 12
26+
:padding-top 7
27+
:padding-bottom 8
28+
:border-radius 16
29+
:border-width 1
30+
:border-color (colors/theme-colors colors/neutral-10 colors/neutral-90 theme)})
31+
32+
(def slide-button-container
33+
{:position :absolute
34+
:right 20
35+
:left 20
36+
:bottom 20})
37+
38+
(defn section-label
39+
[theme]
40+
{:margin-bottom 8
41+
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
(ns status-im2.contexts.wallet.send.transaction-confirmation.view
2+
(:require
3+
[quo.core :as quo]
4+
[quo.foundations.resources :as quo.resources]
5+
[quo.theme :as quo.theme]
6+
[react-native.core :as rn]
7+
[react-native.safe-area :as safe-area]
8+
[reagent.core :as reagent]
9+
[status-im2.common.resources :as resources]
10+
[status-im2.contexts.wallet.send.transaction-confirmation.style :as style]
11+
[utils.i18n :as i18n]
12+
[utils.re-frame :as rf]))
13+
14+
(defn- transaction-title
15+
[]
16+
[rn/view {:style style/content-container}
17+
[rn/view {:style {:flex-direction :row}}
18+
[quo/text
19+
{:size :heading-1
20+
:weight :semi-bold
21+
:style style/title-container
22+
:accessibility-label :send-label}
23+
(i18n/label :t/send)]
24+
[quo/summary-tag
25+
{:label "150 ETH"
26+
:type :token
27+
:image-source (quo.resources/get-token :eth)}]]
28+
[rn/view
29+
{:style {:flex-direction :row
30+
:margin-top 4}}
31+
[quo/text
32+
{:size :heading-1
33+
:weight :semi-bold
34+
:style style/title-container
35+
:accessibility-label :send-label}
36+
(i18n/label :t/from)]
37+
[quo/summary-tag
38+
{:label "Collectibles vault"
39+
:type :account
40+
:emoji "🍑"
41+
:customization-color :purple}]]
42+
[rn/view
43+
{:style {:flex-direction :row
44+
:margin-top 4}}
45+
[quo/text
46+
{:size :heading-1
47+
:weight :semi-bold
48+
:style style/title-container
49+
:accessibility-label :send-label}
50+
(i18n/label :t/to)]
51+
[quo/summary-tag
52+
{:label "Mark Libot"
53+
:type :user
54+
:image-source (resources/get-mock-image :user-picture-male4)
55+
:customization-color :magenta}]]])
56+
57+
(defn- transaction-from
58+
[status-account-props theme]
59+
[rn/view
60+
{:style {:padding-horizontal 20
61+
:padding-bottom 16}}
62+
[quo/text
63+
{:size :paragraph-2
64+
:weight :medium
65+
:style (style/section-label theme)
66+
:accessibility-label :summary-from-label}
67+
(i18n/label :t/from-capitalized)]
68+
[quo/summary-info
69+
{:type :status-account
70+
:networks? true
71+
:values {:ethereum 150
72+
:optimism 50
73+
:arbitrum 25}
74+
:account-props status-account-props}]])
75+
76+
(defn- transaction-to
77+
[user-props theme]
78+
[rn/view
79+
{:style {:padding-horizontal 20
80+
:padding-bottom 16}}
81+
[quo/text
82+
{:size :paragraph-2
83+
:weight :medium
84+
:style (style/section-label theme)
85+
:accessibility-label :summary-from-label}
86+
(i18n/label :t/to-capitalized)]
87+
[quo/summary-info
88+
{:type :user
89+
:networks? true
90+
:values {:ethereum 150
91+
:optimism 50
92+
:arbitrum 25}
93+
:account-props user-props}]])
94+
95+
(defn- transaction-details
96+
[theme]
97+
[rn/view
98+
{:style {:padding-horizontal 20
99+
:padding-bottom 16}}
100+
[quo/text
101+
{:size :paragraph-2
102+
:weight :medium
103+
:style (style/section-label theme)
104+
:accessibility-label :summary-from-label}
105+
(i18n/label :t/details)]
106+
[rn/view
107+
{:style (style/details-container theme)}
108+
[quo/data-item
109+
{:container-style {:flex 1
110+
:height 36}
111+
:blur? false
112+
:description :default
113+
:icon-right? false
114+
:card? false
115+
:label :none
116+
:status :default
117+
:size :small
118+
:title (i18n/label :t/est-time)
119+
:subtitle "3-5 min"}]
120+
[quo/data-item
121+
{:container-style {:flex 1
122+
:height 36}
123+
:blur? false
124+
:description :default
125+
:icon-right? false
126+
:card? false
127+
:label :none
128+
:status :default
129+
:size :small
130+
:title (i18n/label :t/max-fees)
131+
:subtitle "€188,70"}]
132+
[quo/data-item
133+
{:container-style {:flex 1
134+
:height 36}
135+
:blur? false
136+
:description :default
137+
:icon-right? false
138+
:card? false
139+
:label :none
140+
:status :default
141+
:size :small
142+
:title (i18n/label :t/user-gets {:name "Mark"})
143+
:subtitle "149.99 ETH"}]]])
144+
145+
(defn- f-view-internal
146+
[_]
147+
(let [reset-slider? (reagent/atom false)
148+
margin-top (safe-area/get-top)
149+
biometric-auth? true
150+
on-close #(rf/dispatch [:navigate-back-within-stack :wallet-select-asset])
151+
status-account-props {:customization-color :purple
152+
:size 32
153+
:emoji "🍑"
154+
:type :default
155+
:name "Collectibles vault"
156+
:address "0x0ah...78b"}
157+
user-props {:full-name "M L"
158+
:status-indicator? false
159+
:size :small
160+
:ring-background (resources/get-mock-image :ring)
161+
:customization-color :blue
162+
:name "Mark Libot"
163+
:address "0x0ah...78b"
164+
:status-account (merge status-account-props
165+
{:size 16
166+
:name "New house"
167+
:emoji "🍔"})}]
168+
(fn [{:keys [theme]}]
169+
[rn/view {:style {:flex 1}}
170+
[quo/gradient-cover {:customization-color :purple}]
171+
[rn/view {:style (style/container margin-top)}
172+
[quo/page-nav
173+
{:icon-name :i/arrow-left
174+
:on-press on-close
175+
:accessibility-label :top-bar
176+
:right-side [{:icon-name :i/advanced
177+
:on-press (fn callback [] nil)
178+
:accessibility-label "Advanced"}]}]
179+
[transaction-title]
180+
[transaction-from status-account-props theme]
181+
[transaction-to user-props theme]
182+
[transaction-details theme]
183+
[rn/view {:style style/slide-button-container}
184+
[quo/slide-button
185+
{:size :size/s-48
186+
:customization-color :purple
187+
:on-reset (when @reset-slider? #(reset! reset-slider? false))
188+
:on-complete #(js/alert "Not implemented yet")
189+
:track-icon (if biometric-auth? :i/face-id :password)
190+
:track-text (i18n/label :t/slide-to-send)}]]]])))
191+
192+
(defn view-internal
193+
[props]
194+
[:f> f-view-internal props])
195+
196+
(def view (quo.theme/with-theme view-internal))

src/status_im2/navigation/screens.cljs

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
[status-im2.contexts.wallet.send.input-amount.view :as wallet-send-input-amount]
5656
[status-im2.contexts.wallet.send.select-address.view :as wallet-select-address]
5757
[status-im2.contexts.wallet.send.select-asset.view :as wallet-select-asset]
58+
[status-im2.contexts.wallet.send.transaction-confirmation.view :as wallet-transaction-confirmation]
5859
[status-im2.navigation.options :as options]
5960
[status-im2.navigation.transitions :as transitions]))
6061

@@ -312,6 +313,10 @@
312313
:options {:insets {:top? true}}
313314
:component wallet-select-asset/view}
314315

316+
{:name :wallet-transaction-confirmation
317+
:options {:insets {:bottom? true}}
318+
:component wallet-transaction-confirmation/view}
319+
315320
{:name :scan-address
316321
:options (merge
317322
options/dark-screen

translations/en.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -2406,5 +2406,9 @@
24062406
"send-limit": "Max: {{limit}}",
24072407
"searching-for-activity": "Searching for activity...",
24082408
"this-address-has-no-activity": "This address has no activity",
2409-
"this-address-has-activity": "This address has activity"
2409+
"this-address-has-activity": "This address has activity",
2410+
"details": "Details",
2411+
"est-time": "Est. time",
2412+
"user-gets": "{{name}} gets",
2413+
"slide-to-send": "Slide to send"
24102414
}

0 commit comments

Comments
 (0)