Skip to content

Commit 02f8fce

Browse files
tumanov-alexJ-Son89
authored andcommitted
Add transaction_sheet
Add locked input component, tests, styles Add translations Add duration icons Remove extra code Use theme from context Add missing code Update styles Update gas icon (previous was not reacting to size change) Use text from components instead of rn/text Fix styling for transaction sheet preview, locked input & account selector components Fix purple 50 color since it doesn't match design Work on PR suggestions Fix style to be pixel-perfect Comment-in tests Fix style Add docs for locked-input component Remove extra code Fixed design discrepancies Fix font-weight Fix purple color in account selector Remove unused icons Fix linter Fix tests fix for airplane mode [161108] Optimize message styling when there's multiple mentions on top of each other (#16505) Fix failing mute till test (#16453) fix navigation to community from discover communities screen (#16702) Update version to 0.162.3 [#16703] The display name is not resolved in chats for user sender after relogin (#16704) Mute community * mute and unmute community status-im/status-go@dfdaa72...e6187ae * mute and unmute community and all community chats status-im/status-go@dfdaa72...3abc86e * updated statu-go status-im/status-go@dfdaa72...919123e * refactored mute chat drawer status-im/status-go@d3e650d...3af0b17 * refactored mute chat drawer status-im/status-go@dfdaa72...3af0b17 * fixing mute channels * fixed mute community channels * update community chats mute status status-im/status-go@dfdaa72...dc50ac2 * added mute and unmute community toast status-im/status-go@dfdaa72...c06f7a6 * unmute community when atleast one community channel is unmuted status-im/status-go@dfdaa72...e691c47 * updated status-go status-im/status-go@b2e56f5...c52718c * updated status-go version v0.162.5 [Fix] Scroll to bottom on editing message (#16630) This commit fixes (by skipping) the scroll to the bottom of messages when the user edits a message and sends it. Signed-off-by: Mohamed Javid <[email protected]> Refactor `Bottom Sheet` to use Theme Context (#16710) This commit updates "Bottom Sheet" to use the theme (for theme provider) provided on the bottom sheet args when dispatching. This will ensure the theme is passed down to its child components where it can consume and render based on the theme. Changes done: In Bottom Sheet: - Fix Bottom Sheet to use the correct background colour (neutral-95) for dark mode (as per Figma) - Fix the Icon colour for danger in light mode - Updated Quo2 Preview to provide an option for the bottom sheet theme In Action Drawer: - Refactor the Action Drawer component to consume theme context Signed-off-by: Mohamed Javid <[email protected]> Revert extra commits Revert extra commits Revert extra changes
1 parent d143b1d commit 02f8fce

File tree

14 files changed

+183
-0
lines changed

14 files changed

+183
-0
lines changed
-527 Bytes
Binary file not shown.
-899 Bytes
Binary file not shown.
118 Bytes
Loading
332 Bytes
Loading
-197 Bytes
Loading
-290 Bytes
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(ns quo2.components.inputs.locked-input.component-spec
2+
(:require [quo2.components.inputs.locked-input.view :as locked-input]
3+
[test-helpers.component :as h]))
4+
5+
(h/describe "Locked Input"
6+
(h/test "renders label, value and icon"
7+
(h/render [locked-input/locked-input
8+
{:label-text "Label"
9+
:icon :i/gas} "Value"])
10+
(h/is-truthy (h/query-by-text "Label"))
11+
(h/is-truthy (h/get-by-text "Value")))
12+
13+
(h/test "no value"
14+
(h/render [locked-input/locked-input
15+
{:label-text "Label"
16+
:icon :i/gas}])
17+
(h/is-null (h/query-by-text "Value"))
18+
(h/is-truthy (h/get-by-text "Label")))
19+
20+
(h/test "no emoji"
21+
(h/render [locked-input/locked-input
22+
{:label-text "Label"} "Value"])
23+
(h/is-truthy (h/get-by-text "Label"))
24+
(h/is-truthy (h/get-by-text "Value"))))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(ns quo2.components.inputs.locked-input.style
2+
(:require [quo2.foundations.colors :as colors]))
3+
4+
(defn info-box-container
5+
[theme]
6+
{:flex-direction :row
7+
:border-radius 12
8+
:align-items :center
9+
:background-color (colors/theme-colors colors/neutral-10
10+
colors/neutral-80-opa-80
11+
theme)
12+
:height 40
13+
:padding-horizontal 12
14+
:padding-vertical 9
15+
:margin-top 4})
16+
17+
(defn info-box-label
18+
[theme]
19+
{:color (colors/theme-colors colors/black colors/white theme)
20+
:margin-left 8})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
(ns quo2.components.inputs.locked-input.view
2+
(:require [react-native.core :as rn]
3+
[quo2.foundations.colors :as colors]
4+
[quo2.components.icon :as icons]
5+
[quo2.components.inputs.locked-input.style :as style]
6+
[quo2.theme :as quo.theme]
7+
[quo2.components.markdown.text :as text]))
8+
9+
(defn- info-box
10+
[{:keys [icon value-text theme]}]
11+
[rn/view
12+
{:style (style/info-box-container theme)}
13+
[rn/view
14+
(when icon
15+
[icons/icon icon
16+
{:color (colors/theme-colors colors/neutral-50
17+
colors/neutral-40
18+
theme)}])]
19+
[text/text
20+
{:size :paragraph-1
21+
:style (style/info-box-label theme)} value-text]])
22+
23+
(defn- locked-input-internal
24+
[{:keys [label-text icon style theme]} value]
25+
[rn/view {:style style}
26+
[text/text
27+
{:size :paragraph-2
28+
:weight :medium
29+
:style {:color colors/neutral-40}} label-text]
30+
[info-box
31+
{:theme theme
32+
:icon icon
33+
:value-text value}]])
34+
35+
(def locked-input
36+
"Options:
37+
38+
:label-text - string (default nil) - Text to display above the input
39+
:icon - keyword (default nil) - Icon to display in the info box
40+
:style - style map (default nil) - Override style for the container
41+
:theme - :light/:dark
42+
43+
:value - string (default nil) - value to display in the info box"
44+
(quo.theme/with-theme locked-input-internal))

src/quo2/core.cljs

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
quo2.components.inputs.recovery-phrase.view
5050
quo2.components.inputs.search-input.view
5151
quo2.components.inputs.title-input.view
52+
quo2.components.inputs.locked-input.view
5253
quo2.components.keycard.view
5354
quo2.components.links.link-preview.view
5455
quo2.components.links.url-preview-list.view
@@ -205,6 +206,7 @@
205206
(def recovery-phrase-input quo2.components.inputs.recovery-phrase.view/recovery-phrase-input)
206207
(def search-input quo2.components.inputs.search-input.view/search-input)
207208
(def title-input quo2.components.inputs.title-input.view/title-input)
209+
(def locked-input quo2.components.inputs.locked-input.view/locked-input)
208210

209211
;;;; NUMBERED KEYBOARD
210212
(def keyboard-key quo2.components.numbered-keyboard.keyboard-key.view/view)

src/quo2/core_spec.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
[quo2.components.graph.wallet-graph.component-spec]
2525
[quo2.components.inputs.input.component-spec]
2626
[quo2.components.inputs.profile-input.component-spec]
27+
[quo2.components.inputs.locked-input.component-spec]
2728
[quo2.components.inputs.recovery-phrase.component-spec]
2829
[quo2.components.inputs.title-input.component-spec]
2930
[quo2.components.keycard.component-spec]

src/status_im2/contexts/quo_preview/main.cljs

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@
101101
[status-im2.contexts.quo-preview.tags.tags :as tags]
102102
[status-im2.contexts.quo-preview.tags.token-tag :as token-tag]
103103
[status-im2.contexts.quo-preview.title.title :as title]
104+
[status-im2.contexts.quo-preview.transaction-sheet.transaction-sheet :as
105+
transaction-sheet]
104106
[status-im2.contexts.quo-preview.keycard.keycard :as keycard]
105107
[status-im2.contexts.quo-preview.loaders.skeleton :as skeleton]
106108
[status-im2.contexts.quo-preview.community.channel-actions :as channel-actions]
@@ -414,6 +416,10 @@
414416
:text-combinations [{:name :title
415417
:options {:topBar {:visible true}}
416418
:component title/preview-title}]
419+
:transaction-sheet [{:name :transaction-sheet
420+
:options {:topBar {:visible true}}
421+
:component transaction-sheet/preview-transaction-sheet
422+
}]
417423
:wallet [{:name :account-card
418424
:options {:topBar {:visible true}}
419425
:component account-card/preview-account-card}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
(ns status-im2.contexts.quo-preview.transaction-sheet.transaction-sheet
2+
(:require [quo2.components.tabs.account-selector :as acc-sel]
3+
[utils.i18n :as i18n]
4+
[quo2.foundations.colors :as colors]
5+
[react-native.core :as rn]
6+
[status-im2.contexts.quo-preview.tabs.segmented-tab]
7+
[quo2.components.tabs.segmented-tab :as quo2]
8+
[status-im2.contexts.shell.jump-to.utils :as utils]
9+
[quo2.components.inputs.locked-input.view :as locked-input]
10+
[quo2.components.markdown.text :as text]))
11+
12+
(let [{:keys [width]} (utils/dimensions)]
13+
(def screen-width width))
14+
(def account-selector-width (* 0.895 screen-width))
15+
(def shared-selector-list-data
16+
{:show-label? false
17+
:transparent? false
18+
:style {:width account-selector-width
19+
:height 40}})
20+
(def unique-selector-list-data
21+
[{:account-text "Drakaris account"
22+
:account-emoji "🔥"}
23+
{:account-text "Daenerys account"
24+
:account-emoji "👸"}])
25+
(def selector-list-data
26+
(map #(merge % shared-selector-list-data)
27+
unique-selector-list-data))
28+
29+
(defn- render-account-selectors
30+
[item]
31+
[rn/view {:style {:margin-right 10}}
32+
[rn/touchable-opacity {:on-press #(js/alert (str "Pressed " (item :account-text)))}
33+
[acc-sel/account-selector item]]])
34+
(defn preview-transaction-sheet
35+
[]
36+
[rn/view
37+
{:background-color (colors/theme-colors colors/white colors/neutral-90)
38+
:flex 1
39+
:flex-direction :column
40+
:padding-top 20
41+
:padding-left 20}
42+
[text/text
43+
{:size :heading-2
44+
:weight :semi-bold
45+
:style {:color (colors/theme-colors
46+
colors/black
47+
colors/white)
48+
}} "Sign transaction with Rarible"]
49+
[quo2/segmented-control
50+
{:size 28
51+
:blur? false
52+
:default-active 1
53+
:container-style {:margin-top 19
54+
:margin-right 20}
55+
:data [{:id 1
56+
:label (i18n/label :t/simple)}
57+
{:id 2
58+
:label (i18n/label :t/advanced)}]}]
59+
[rn/view {:style {:margin-top 19}}
60+
[text/text
61+
{:size :paragraph-2
62+
:weight :medium
63+
:style {:color colors/neutral-40}}
64+
(i18n/label
65+
:t/select-account)]
66+
[rn/flat-list
67+
{:data selector-list-data
68+
:render-fn render-account-selectors
69+
:horizontal true
70+
:shows-horizontal-scroll-indicator false
71+
:style {:margin-top 4}}]
72+
[rn/view
73+
{:style {:margin-top 11
74+
:flex-direction :row}}
75+
[locked-input/locked-input
76+
{:icon :i/gas
77+
:label-text (i18n/label :t/network-fee)
78+
:style {:margin-right 15
79+
:width 160}} "$1,648.34"]
80+
[locked-input/locked-input
81+
{:icon :i/duration
82+
:label-text (i18n/label :t/duration-estimate)
83+
:style {:margin-right 18
84+
:width 160}} "~3 min"]]]])

translations/en.json

+2
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@
738738
"join-decentralised-communities": "Join Decentralized Communities",
739739
"http-gateway-error": "Oops, request failed!",
740740
"sign-request-failed": "Could not sign message",
741+
"simple": "Simple",
741742
"invite-friends": "Invite friends",
742743
"invite-people": "Invite people",
743744
"invite-people-from-contacts": "Invite people from contact list",
@@ -784,6 +785,7 @@
784785
"dapp-starter-pack-title": "Starter Pack",
785786
"dapp-starter-pack-description": "Here’s some crypto to get you started! Use it to get stickers, an ENS name and try dapps",
786787
"dapp-starter-pack-accept": "Accept and Open",
788+
"duration-estimate": "Duration estimate",
787789
"starter-pack-coming": "Starter Pack coming your way",
788790
"starter-pack-coming-description": "Can take a few minutes to hours",
789791
"starter-pack-received": "Starter Pack received",

0 commit comments

Comments
 (0)