-
Notifications
You must be signed in to change notification settings - Fork 16
feat: updated transfer ui with a cleaner look #57
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
base: master
Are you sure you want to change the base?
Conversation
| use eframe::egui::{self, Color32, Response, Ui}; | ||
|
|
||
| /// Layout dimensions | ||
| pub struct LayoutDimensions; |
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.
Why is this a struct? This could be a module
| } | ||
|
|
||
| /// Layout colors | ||
| pub struct LayoutColors; |
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.
Why is this a struct? This could be a module
| } | ||
|
|
||
| /// Helper functions for layout | ||
| pub struct LayoutHelpers; |
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.
Why is this a struct? This could be a module
| if !self.amount.is_empty() && amount.is_err() { | ||
| ui.add_space(LayoutDimensions::SMALL_SPACING); | ||
| ui.colored_label( | ||
| egui::Color32::from_rgb(255, 0, 0), |
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.
Colors should be defined as consts somewhere
| { | ||
| // Set a maximum length of 62 characters for Bitcoin addresses | ||
| // This covers all Bitcoin address formats (P2PKH, P2SH, Bech32, etc.) | ||
| if self.mainchain_address.len() > 62 { |
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.
the 62 should be defined as a const somewhere
| // Set a maximum length of 62 characters for Bitcoin addresses | ||
| // This covers all Bitcoin address formats (P2PKH, P2SH, Bech32, etc.) | ||
| if self.mainchain_address.len() > 62 { | ||
| self.mainchain_address.truncate(62); |
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.
Truncation seems like the wrong behavior here. If the address is too long to be parsed, then displaying a parse error is preferable
Updated the transfer UI to have a better look.