brave / brave-ios

Brave iOS Browser
https://brave.com
Mozilla Public License 2.0
1.7k stars 440 forks source link

Fix #8137: Asset detail v2 #8595

Closed nuo-xu closed 10 months ago

nuo-xu commented 10 months ago

Summary of Changes

This pull request fixes #8137

Submitter Checklist:

Test Plan:

Note: Design mistakenly combine market coin info with other assets. Their information are coming from different source in different data structure with no correlation, thus these two info cannot be put in the same screen. This means, in asset detail, we will have Acconts and Transactions. But market coin detail will have no tabs with some new ui updates.

Screenshots:

Simulator Screenshot - iPhone 15 Pro - 2023-12-28 at 21 56 08 Simulator Screenshot - iPhone 15 Pro - 2023-12-28 at 21 56 11 Simulator Screenshot - iPhone 15 Pro - 2023-12-28 at 21 56 25
Simulator Screenshot - iPhone 15 Pro - 2023-12-28 at 21 56 42 Simulator Screenshot - iPhone 15 Pro - 2023-12-28 at 21 56 40 Simulator Screenshot - iPhone 15 Pro - 2023-12-28 at 21 56 34

Reviewer Checklist:

github-actions[bot] commented 10 months ago

[puLL-Merge] - brave/brave-ios@8595

Description

This PR adds support for dark and light theme images on iOS as well as refactors some of the views in the BraveWallet in the Brave iOS app. The change focuses on adding themed images for account and transaction empty states across the application and includes various code updates in Swift files to enhance consistency and maintainability.

Changes ### Changes **Asset xcassets** - Added new themed images for account and transaction empty states, providing dark and light variants. **Swift UI Views** - Refactored UI components to use the newly added images and adjusted fonts, padding, and other styling parameters. - Streamlined the layout of some views to improve readability and simplify UI hierarchy. **AssetDetailStore.swift** - Removed redundant BTC ratio tracking and updated balance fetch routines for accounts and transactions. - Improved and organized the transaction sections and summaries fetch and filtered transactions properly based on the asset type. - Cleaned up and optimized async/await calls to reduce initial state loading time and improved caching of asset prices and estimated transaction fees. **PortfolioHeaderView.swift** - Refactored code to separate highly reusable view components, such as the time frame selector and header buttons, for better modularity. **WalletPromptView.swift** - Adjusted secondary and primary button styles for consistency with design specifications. **Localization (Strings)** - Updated and added new localized strings to support the revised and new UI elements and states.

Security Hotspots

No obvious security hotspots are present in the changes. The modifications are primarily related to UI view layout logic and asynchronous data fetching, with no direct security or privacy implications. However, the correctness of data handling during async calls should be carefully reviewed to prevent data races or potential inconsistencies that may misrepresent a user's holdings or transactions.

Order by risk: