Conversation
PR SummaryAdded new "Earn" feature UI components to the wallet interface. Introduced an Changes
autogenerated by presubmit.ai |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
🚨 Pull request needs attention.
Review Summary
Commits Considered (1)
- 37c902d: feat: earn button on home
Files Processed (7)
- FRW.xcodeproj/project.pbxproj (5 hunks)
- FRW/Foundation/Define/AppUrl.swift (1 hunk)
- FRW/Modules/Wallet/View/EarnButton.swift (1 hunk)
- FRW/Modules/Wallet/WalletHomeView.swift (1 hunk)
- FRW/Modules/Wallet/WalletViewModel.swift (1 hunk)
- FRW/Resource/Assets.xcassets/wallet/earn_icon.imageset/Contents.json (1 hunk)
- FRW/Resource/Assets.xcassets/wallet/earn_icon.imageset/earn_icon.svg (1 hunk)
Actionable Comments (2)
-
FRW/Foundation/Define/AppUrl.swift [13-13]
possible bug: "Empty URL will cause the Earn button to always fail."
-
FRW/Modules/Wallet/WalletViewModel.swift [189-189]
possible bug: "Button visibility should be tied to URL availability."
Skipped Comments (1)
-
FRW/Modules/Wallet/View/EarnButton.swift [16-16]
enhancement: "Non-localized and informal error message."
| enum AppUrl { | ||
| static let cadenceSwapUrl = "https://app.increment.fi" | ||
| static let evmSwapUrl = "https://swap.flow.com" | ||
| static let earnUrl = "" //TODO: #six 3.1.1 |
There was a problem hiding this comment.
The earnUrl is set to an empty string with a TODO comment. This will cause the button to always show an error message ("don't have earn url") when clicked since URL(string: "") returns nil. Consider either:
- Setting
showEarnButtontofalseuntil the URL is available - Adding a proper placeholder URL
- Hiding the button when the URL is empty
|
|
||
|
|
||
| @Published | ||
| var showEarnButton: Bool = true |
There was a problem hiding this comment.
The showEarnButton is hardcoded to true. Consider deriving this value from whether AppUrl.earnUrl is empty or not, e.g., var showEarnButton: Bool { !AppUrl.earnUrl.isEmpty }. This would prevent showing a non-functional button.
There was a problem hiding this comment.
🚨 Pull request needs attention.
Review Summary
Commits Considered (1)
- 999a1f1: feat: add earn banner to token detail
Files Processed (6)
- FRW.xcodeproj/project.pbxproj (7 hunks)
- FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift (1 hunk)
- FRW/Modules/Wallet/TokenDetail/TokenDetailViewModel.swift (1 hunk)
- FRW/Modules/Wallet/View/EarnBanner.swift (1 hunk)
- FRW/Resource/Assets.xcassets/wallet/earn_icon_36.imageset/Contents.json (1 hunk)
- FRW/Resource/Assets.xcassets/wallet/earn_icon_36.imageset/earn_icon_36.pdf (0 hunks)
Actionable Comments (1)
-
FRW/Modules/Wallet/View/EarnBanner.swift [40-40]
possible bug: "Incorrect frame modifier usage."
Skipped Comments (3)
-
FRW/Modules/Wallet/View/EarnBanner.swift [21-28]
possible issue: "Hardcoded financial values in the UI may become stale."
-
FRW/Modules/Wallet/View/EarnBanner.swift [17-17]
enhancement: "User-facing error message is not professional."
-
FRW/Modules/Wallet/TokenDetail/TokenDetailViewModel.swift [188-189]
possible issue: "Banner visibility is always enabled without conditional logic."
| .clipShape(Circle()) | ||
| } | ||
| .padding(18) | ||
| .frame(width: .infinity, alignment: .leading) |
There was a problem hiding this comment.
Using .frame(width: .infinity, ...) is incorrect syntax. To make the view expand to fill available width, use .frame(maxWidth: .infinity, alignment: .leading) instead.
There was a problem hiding this comment.
✅ LGTM!
Review Summary
Commits Considered (1)
- 65ea0c2: feat: add flag to earn
Files Processed (2)
- FRW/Modules/Wallet/TokenDetail/TokenDetailViewModel.swift (1 hunk)
- FRW/Modules/Wallet/WalletViewModel.swift (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
-
FRW/Modules/Wallet/TokenDetail/TokenDetailViewModel.swift [188-189]
possible issue: "Published property initialized with static value may not reflect runtime changes."
-
FRW/Modules/Wallet/WalletViewModel.swift [188-189]
possible issue: "Published property initialized with static value may not reflect runtime changes."
Related Issue
Summary of Changes
Need Regression Testing
Risk Assessment
Additional Notes
Screenshots (if applicable)