This repository was archived by the owner on Mar 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
WalletConnector/Sources/WalletConnector/Scenes
Packages/PrimitivesComponents/Sources/Views Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ public struct EarnScene: View {
1515
1616 public var body : some View {
1717 List {
18+ ListAssetHeaderView ( model: model. assetModel)
19+
1820 switch model. providersState {
1921 case . noData:
2022 Section {
@@ -24,7 +26,7 @@ public struct EarnScene: View {
2426 ListItemLoadingView ( )
2527 . id ( UUID ( ) )
2628 case . data:
27- Section ( model . assetTitle ) {
29+ Section {
2830 ListItemView (
2931 title: model. aprModel. title,
3032 subtitle: model. aprModel. subtitle
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public struct StakeScene: View {
1717
1818 public var body : some View {
1919 List {
20+ headerSection
2021 stakeInfoSection
2122 if model. showManage {
2223 stakeSection
@@ -42,6 +43,10 @@ public struct StakeScene: View {
4243// MARK: - UI Components
4344
4445extension StakeScene {
46+ private var headerSection : some View {
47+ ListAssetHeaderView ( model: model. assetModel)
48+ }
49+
4550 private var stakeSection : some View {
4651 Section ( Localized . Common. manage) {
4752 if model. showStake {
@@ -97,7 +102,7 @@ extension StakeScene {
97102 }
98103
99104 private var stakeInfoSection : some View {
100- Section ( model . assetTitle ) {
105+ Section {
101106 ListItemView (
102107 title: model. stakeAprModel. title,
103108 subtitle: model. stakeAprModel. subtitle,
Original file line number Diff line number Diff line change @@ -49,7 +49,10 @@ public final class EarnSceneViewModel {
4949 }
5050
5151 var title : String { Localized . Common. earn }
52- var assetTitle : String { AssetViewModel ( asset: asset) . title }
52+
53+ var assetModel : AssetViewModel {
54+ AssetViewModel ( asset: asset)
55+ }
5356
5457 private var apr : Double ? {
5558 providers. first. map ( \. apr) . flatMap { $0 > 0 ? $0 : nil }
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ public final class StakeSceneViewModel {
5959
6060 var stakeTitle : String { Localized . Transfer. Stake. title }
6161 var claimRewardsTitle : String { Localized . Transfer. ClaimRewards. title }
62- var assetTitle : String { assetModel. title }
6362 var delegationsTitle : String { Localized . Stake. delegations }
6463
6564 var stakeAprModel : AprViewModel {
@@ -240,7 +239,7 @@ extension StakeSceneViewModel {
240239 return formatter
241240 } ( )
242241
243- private var assetModel : AssetViewModel {
242+ var assetModel : AssetViewModel {
244243 AssetViewModel ( asset: asset)
245244 }
246245
Original file line number Diff line number Diff line change @@ -21,12 +21,7 @@ public struct ConnectionProposalScene: View {
2121
2222 public var body : some View {
2323 List {
24- Section { } header: {
25- AssetPreviewView ( model: model. appPreview, subtitleLayout: . vertical)
26- . frame ( maxWidth: . infinity)
27- . padding ( . bottom, . small)
28- }
29- . cleanListRow ( )
24+ ListAssetHeaderView ( model: model. appPreview, subtitleLayout: . vertical)
3025
3126 Section {
3227 NavigationLink ( value: Scenes . SelectWallet ( ) ) {
Original file line number Diff line number Diff line change @@ -21,12 +21,7 @@ public struct SignMessageScene: View {
2121
2222 public var body : some View {
2323 List {
24- Section { } header: {
25- AssetPreviewView ( model: model. appPreview, subtitleLayout: . vertical)
26- . frame ( maxWidth: . infinity)
27- . padding ( . bottom, . small)
28- }
29- . cleanListRow ( )
24+ ListAssetHeaderView ( model: model. appPreview, subtitleLayout: . vertical)
3025
3126 Section {
3227 ListItemImageView (
Original file line number Diff line number Diff line change 1+ // Copyright (c). Gem Wallet. All rights reserved.
2+
3+ import SwiftUI
4+ import Components
5+ import Style
6+
7+ public struct ListAssetHeaderView < Model: AssetPreviewable > : View {
8+ private let model : Model
9+ private let subtitleLayout : AssetPreviewView < Model > . SubtitleLayout
10+
11+ public init ( model: Model , subtitleLayout: AssetPreviewView < Model > . SubtitleLayout = . horizontal) {
12+ self . model = model
13+ self . subtitleLayout = subtitleLayout
14+ }
15+
16+ public var body : some View {
17+ Section { } header: {
18+ AssetPreviewView ( model: model, subtitleLayout: subtitleLayout)
19+ . frame ( maxWidth: . infinity)
20+ . padding ( . bottom, . small)
21+ }
22+ . cleanListRow ( )
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments