Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Add asset image header on Stake and Earn views#1836

Merged
gemdev111 merged 1 commit intomainfrom
feature/stake-earn-asset-header
Mar 26, 2026
Merged

Add asset image header on Stake and Earn views#1836
gemdev111 merged 1 commit intomainfrom
feature/stake-earn-asset-header

Conversation

@gemdev111
Copy link
Copy Markdown
Contributor

@gemdev111 gemdev111 commented Mar 26, 2026

Replace text section titles with asset image header (logo + name) on Stake and Earn views, matching the pattern used in RecipientScene.

  • Extract reusable ListAssetHeaderView in PrimitivesComponents
  • Add asset image header to StakeScene and EarnScene
  • Deduplicate inline Section { } header: blocks in WalletConnector scenes
  • Remove unused assetTitle properties

Stake ETH Earn USDC

Close: #1831

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the display of asset information in the Stake and Earn features, as well as in WalletConnector scenes, by introducing a new, reusable ListAssetHeaderView component. This change streamlines the UI code, promotes consistency in how asset headers are presented, and removes deprecated properties, leading to a cleaner and more maintainable codebase.

Highlights

  • Standardized Asset Headers: Implemented a consistent asset image header (logo + name) across Stake and Earn views, aligning with existing patterns.
  • Reusable Component Extraction: Extracted ListAssetHeaderView into PrimitivesComponents for improved reusability.
  • UI Simplification: Replaced inline Section { } header: blocks in WalletConnector scenes with the new ListAssetHeaderView.
  • Code Cleanup: Removed redundant assetTitle properties from view models.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemdev111 gemdev111 self-assigned this Mar 26, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new ListAssetHeaderView component to standardize the display of asset headers within List views, replacing duplicated code in EarnScene, StakeScene, ConnectionProposalScene, and SignMessageScene. View models were refactored to expose AssetViewModel directly. The review suggests improving the encapsulation of ListAssetHeaderView by defining a local SubtitleLayout enum instead of exposing AssetPreviewView.SubtitleLayout in its public API.

Comment on lines +9 to +14
private let subtitleLayout: AssetPreviewView<Model>.SubtitleLayout

public init(model: Model, subtitleLayout: AssetPreviewView<Model>.SubtitleLayout = .horizontal) {
self.model = model
self.subtitleLayout = subtitleLayout
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To improve encapsulation, consider defining a local SubtitleLayout enum for this view rather than exposing AssetPreviewView.SubtitleLayout in the public API. This decouples ListAssetHeaderView from the implementation details of AssetPreviewView.

You can then add the new enum and a private computed property to map to the AssetPreviewView.SubtitleLayout:

public enum SubtitleLayout {
    case horizontal
    case vertical
}

private var assetPreviewSubtitleLayout: AssetPreviewView<Model>.SubtitleLayout {
    switch subtitleLayout {
    case .horizontal: .horizontal
    case .vertical: .vertical
    }
}

Then, use assetPreviewSubtitleLayout in the body.

Suggested change
private let subtitleLayout: AssetPreviewView<Model>.SubtitleLayout
public init(model: Model, subtitleLayout: AssetPreviewView<Model>.SubtitleLayout = .horizontal) {
self.model = model
self.subtitleLayout = subtitleLayout
}
private let subtitleLayout: SubtitleLayout
public init(model: Model, subtitleLayout: SubtitleLayout = .horizontal) {
self.model = model
self.subtitleLayout = subtitleLayout
}

@gemdev111 gemdev111 force-pushed the feature/stake-earn-asset-header branch from 07a3d2f to 29ee438 Compare March 26, 2026 14:34
@gemdev111 gemdev111 merged commit d11ce2f into main Mar 26, 2026
2 checks passed
@gemdev111 gemdev111 deleted the feature/stake-earn-asset-header branch March 26, 2026 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add header on staking and earn view

2 participants