-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screens for editing transaction settings #21838
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,16 @@ | |
:theme theme | ||
:blur? blur?}) | ||
container-style)} | ||
[preview-list/view | ||
{:type :network | ||
:number (count networks) | ||
:size :size-16} | ||
networks] | ||
(when networks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
[preview-list/view | ||
{:type :network | ||
:number (count networks) | ||
:size :size-16} | ||
networks]) | ||
[text/text | ||
{:weight :medium | ||
:size :paragraph-2 | ||
:style (style/title-style {:status status | ||
:theme theme})} | ||
:style (style/title-style {:status status | ||
:theme theme | ||
:networks-shown? networks})} | ||
title]])) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,18 @@ | |
(string/upper-case (or (clj->js text) ""))]) | ||
|
||
(defn input-section | ||
[{:keys [token-symbol on-token-press value error? on-swap currency-symbol]}] | ||
(let [theme (quo.theme/use-theme) | ||
window-width (:width (rn/get-window))] | ||
[{:keys [token-symbol on-token-press value error? on-swap currency-symbol show-token-icon? | ||
swappable?]}] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two new features of |
||
(let [theme (quo.theme/use-theme)] | ||
[rn/pressable | ||
{:style {:width "100%" | ||
:flex-direction :row} | ||
:on-press on-token-press} | ||
[token/view | ||
{:token token-symbol | ||
:size :size-32}] | ||
[rn/view {:style (style/input-container window-width)} | ||
(when show-token-icon? | ||
[token/view | ||
{:token token-symbol | ||
:size :size-32}]) | ||
[rn/view {:style style/input-container} | ||
[rn/text-input | ||
{:style (style/text-input theme error?) | ||
:placeholder-text-color (style/placeholder-text theme) | ||
|
@@ -39,14 +40,15 @@ | |
:editable false | ||
:value value}] | ||
[token-name-text theme currency-symbol]] | ||
[button/button | ||
{:icon true | ||
:icon-only? true | ||
:size 32 | ||
:on-press #(when on-swap (on-swap)) | ||
:type :outline | ||
:accessibility-label :reorder} | ||
:i/reorder]])) | ||
(when swappable? | ||
[button/button | ||
{:icon true | ||
:icon-only? true | ||
:size 32 | ||
:on-press #(when on-swap (on-swap)) | ||
:type :outline | ||
:accessibility-label :reorder} | ||
:i/reorder])])) | ||
|
||
(defn- view-internal | ||
[{:keys [token-symbol | ||
|
@@ -57,26 +59,33 @@ | |
on-swap | ||
converted-value | ||
hint-component | ||
currency-symbol]}] | ||
show-token-icon? | ||
currency-symbol | ||
swappable?] | ||
:or {show-token-icon? true | ||
swappable? true}}] | ||
(let [theme (quo.theme/use-theme) | ||
width (:width (rn/get-window))] | ||
[rn/view {:style (merge (style/main-container width) container-style)} | ||
[rn/view {:style style/amount-container} | ||
[input-section | ||
{:theme theme | ||
:token-symbol token-symbol | ||
:on-token-press on-token-press | ||
:value value | ||
:error? error? | ||
:on-swap on-swap | ||
:currency-symbol currency-symbol}]] | ||
{:theme theme | ||
:token-symbol token-symbol | ||
:on-token-press on-token-press | ||
:value value | ||
:error? error? | ||
:on-swap on-swap | ||
:currency-symbol currency-symbol | ||
:show-token-icon? show-token-icon? | ||
:swappable? swappable?}]] | ||
[divider-line/view {:container-style (style/divider theme)}] | ||
[rn/view {:style style/data-container} | ||
hint-component | ||
[text/text | ||
{:size :paragraph-2 | ||
:weight :medium | ||
:style (style/converted-amount theme)} | ||
converted-value]]])) | ||
(when swappable? | ||
[text/text | ||
{:size :paragraph-2 | ||
:weight :medium | ||
:style (style/converted-amount theme)} | ||
converted-value])]])) | ||
|
||
(def view (schema/instrument #'view-internal component-schema/?schema)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ | |
(when (money/bignumber? (value-bn state)) | ||
(money/greater-than (value-bn state) (upper-limit-bn state))))) | ||
|
||
(defn- lower-limit-exceeded? | ||
(defn lower-limit-exceeded? | ||
[state] | ||
(and (lower-limit state) | ||
(when (money/bignumber? (value-bn state)) | ||
|
@@ -78,16 +78,19 @@ | |
|
||
(defn set-upper-limit | ||
[state limit] | ||
(when limit | ||
(if limit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this change |
||
(-> state | ||
(assoc :upper-limit limit) | ||
recheck-errorness))) | ||
recheck-errorness) | ||
state)) | ||
|
||
(defn set-lower-limit | ||
[state limit] | ||
(-> state | ||
(assoc :lower-limit limit) | ||
recheck-errorness)) | ||
(if limit | ||
(-> state | ||
(assoc :lower-limit limit) | ||
recheck-errorness) | ||
state)) | ||
|
||
(defn increase | ||
[state] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In designs input field has labels at top-left and top-right sides. In our component we had only characters counter in the right side, so i added a right-side label.