Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Dec 17, 2024

fixes #21023 #21024

Summary

Implemented screens for editing Max base fee, Priority fee, Nonce and Max gas amount.
This is only UI implementation and it is hidden under feature flag.
status-go pr is not merged yet, so integration with status-go will be made separately

Screen.Recording.2024-12-17.at.15.50.35.mov

Review notes

Figma designs
In figma designs "max base fee" and "priority fee" use token-input component with swap button that allows switching between fiat and crypto. In my implementation there is no switching because it is not practical. 1 gwei is just a fraction of cent and user will never operate in fiat to set fees. Also we never operate with values less than 1 cent in other parts of our app. (cc @xAlisher)

Testing notes

Platforms

  • Android
  • iOS

Areas that maybe impacted

Functional
  • wallet / transactions

Steps to test

  • Open Status
  • Start send flow, reach transaction confirmation screen
  • Press transaction settings button, select "custom" menu and try different options

status: ready

@vkjr vkjr self-assigned this Dec 17, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Dec 17, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
46862df #1 2024-12-17 15:39:32 ~2 min ios 📄log
46862df #1 2024-12-17 15:41:31 ~4 min tests 📄log
✔️ 46862df #1 2024-12-17 15:44:35 ~8 min android-e2e 🤖apk 📲
✔️ 46862df #1 2024-12-17 15:45:13 ~8 min android 🤖apk 📲
✔️ dd4e08a #2 2024-12-23 12:51:00 ~4 min tests 📄log
✔️ dd4e08a #2 2024-12-23 12:53:00 ~6 min android-e2e 🤖apk 📲
✔️ dd4e08a #2 2024-12-23 12:53:17 ~6 min ios 📱ipa 📲
✔️ dd4e08a #2 2024-12-23 12:54:44 ~8 min android 🤖apk 📲

@@ -7,8 +7,8 @@
[react-native.core :as rn]
[react-native.platform :as platform]))

(defn- label-&-counter
[{:keys [label current-chars char-limit variant-colors theme]}]
(defn- label-line
Copy link
Contributor Author

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.

:number (count networks)
:size :size-16}
networks]
(when networks
Copy link
Contributor Author

@vkjr vkjr Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If networks is empty we don't need this component because it eats some space and leads to incorrect alignment of text after it.

(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?]}]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two new features of token-input:
If not swappable? we won't display the button to swap between crypto and fiat values.
If not show-token-icon? we do not show icon. Because GWEI or UNITS that we enter in transaction settings screens do not have icons.

@@ -78,16 +78,19 @@

(defn set-upper-limit
[state limit]
(when limit
(if limit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change set-upper-limit breaks the usage of -> because no value returned when limit not applied

@@ -768,3 +768,41 @@
:always (update-in [:wallet :ui :send] dissoc :amount :route)
(not keep-tx-data?) (update-in [:wallet :ui :send] dissoc :tx-type))
:fx [[:dispatch [:navigate-back]]]})))

(rf/reg-event-fx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know yet in what form we will get the recommended and current values for transaction settings from status-go, so for now I've stored test values like that. Not a final form I believe.

{:db (all-screens-params db (first comp-id) screen-params)
:fx [[:navigate-to-within-stack (conj comp-id (:theme db))]]})
{:db (all-screens-params db (first comp-id) screen-params)
:dispatch-n [[:hide-bottom-sheet]]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bottom sheets should be hidden when navigate to another screen. Copied from :navigate-to event above in the code.

@vkjr vkjr force-pushed the max-and-priority-fee-ui branch from 46862df to dd4e08a Compare December 23, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: CONTRIBUTOR
Development

Successfully merging this pull request may close these issues.

🖊️⚙️ Implement Input and Validation for Max Base Fee and Priority Fee in Custom TX Parameters
2 participants