Skip to content

Conversation

@zhouxl
Copy link
Collaborator

@zhouxl zhouxl commented Jan 28, 2026

Related Issue

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@zhouxl zhouxl linked an issue Jan 28, 2026 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

PR Summary

Added new "Earn" feature UI components to the wallet interface. Introduced an EarnButton on the wallet home screen and an EarnBanner on the token detail view. Both components navigate to an earn URL (configured via AppUrl.earnUrl) when tapped. The visibility of these components is controlled by a feature flag that checks if the earnUrl is not empty. Added corresponding icon assets for the earn feature.

Changes

File Summary
FRW.xcodeproj/project.pbxproj Added references for new EarnButton.swift and EarnBanner.swift files to the Xcode project build phases and file groups.
FRW/Foundation/Define/AppUrl.swift Added earnUrl static constant to AppUrl enum. Currently set to an empty string with a TODO comment for version 3.1.1.
FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift Added conditional rendering of EarnBanner component below the summary view when vm.showEarnBanner is true.
FRW/Modules/Wallet/TokenDetail/TokenDetailViewModel.swift Added @Published property showEarnBanner that evaluates to true when AppUrl.earnUrl is not empty, controlling the banner visibility.
FRW/Modules/Wallet/View/EarnBanner.swift New file. A promotional banner component displaying APY information with a gradient background. Tapping navigates to the earn URL via the browser route, or shows an error HUD if URL is invalid.
FRW/Modules/Wallet/View/EarnButton.swift New file. A pill-shaped button with "earn" text and icon. Tapping navigates to the earn URL via the browser route, or shows an error HUD if URL is invalid.
FRW/Modules/Wallet/WalletHomeView.swift Added conditional rendering of EarnButton component in the wallet home view when vm.showEarnButton is true, positioned before the menu button.
FRW/Modules/Wallet/WalletViewModel.swift Added @Published property showEarnButton that evaluates to true when AppUrl.earnUrl is not empty, controlling the button visibility.
FRW/Resource/Assets.xcassets/wallet/earn_icon.imageset/Contents.json New file. JSON configuration for the earn_icon image asset referencing the SVG file.
FRW/Resource/Assets.xcassets/wallet/earn_icon.imageset/earn_icon.svg New file. SVG icon showing a green circle with an upward trending arrow, used in the EarnButton component.
FRW/Resource/Assets.xcassets/wallet/earn_icon_36.imageset/Contents.json New file. JSON configuration for the earn_icon_36 image asset referencing the PDF file.
FRW/Resource/Assets.xcassets/wallet/earn_icon_36.imageset/earn_icon_36.pdf New file. PDF icon asset used in the EarnBanner component.

autogenerated by presubmit.ai

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@zhouxl zhouxl linked an issue Jan 28, 2026 that may be closed by this pull request
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🚨 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

Choose a reason for hiding this comment

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

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:

  1. Setting showEarnButton to false until the URL is available
  2. Adding a proper placeholder URL
  3. Hiding the button when the URL is empty



@Published
var showEarnButton: Bool = true

Choose a reason for hiding this comment

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

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.

@zhouxl zhouxl requested a review from lmcmz January 28, 2026 13:28
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🚨 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)

Choose a reason for hiding this comment

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

Using .frame(width: .infinity, ...) is incorrect syntax. To make the view expand to fill available width, use .frame(maxWidth: .infinity, alignment: .leading) instead.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

LGTM!

Review Summary

Commits Considered (1)
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."

@zhouxl zhouxl marked this pull request as ready for review January 30, 2026 06:53
@zhouxl zhouxl requested a review from a team as a code owner January 30, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Add vault entrance to home screen [iOS] Add Earn banner to token detail page

2 participants