diff --git a/DashWallet/Sources/UI/Home/Views/HomeView.swift b/DashWallet/Sources/UI/Home/Views/HomeView.swift index 936bbe8e6..95b028243 100644 --- a/DashWallet/Sources/UI/Home/Views/HomeView.swift +++ b/DashWallet/Sources/UI/Home/Views/HomeView.swift @@ -274,22 +274,20 @@ struct TransactionList: View { @State private var selectedTxDataItem: TransactionListDataItem? = nil @StateObject var viewModel: HomeViewModel - @ViewBuilder var balanceHeader: () -> Content @ViewBuilder var syncingHeader: () -> Content - private let topOverscrollSize: CGFloat = 1000 // Fixed value for top overscroll area var body: some View { ScrollView { - ZStack { Color.dashBlue } // Top overscroll area + ZStack { Color.navigationBarColor } // Top overscroll area .frame(height: topOverscrollSize) .padding(EdgeInsets(top: -topOverscrollSize, leading: 0, bottom: 0, trailing: 0)) LazyVStack(pinnedViews: [.sectionHeaders]) { balanceHeader() - .frame(height: 250) + .frame(height: viewModel.hasNetwork ? 250 : 335) syncingHeader() .frame(height: 50) diff --git a/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift b/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift index 84dcb8d2d..f6b3df166 100644 --- a/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift +++ b/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift @@ -19,6 +19,15 @@ import Foundation class HomeViewModel: ObservableObject { @Published var txItems: Array<(DateKey, [TransactionListDataItem])> = [] + @Published var hasNetwork: Bool = true + private var model: SyncModel = SyncModelImpl() + + init() { + model.networkStatusDidChange = { status in + self.hasNetwork = status == .online + } + self.hasNetwork = model.networkStatus == .online + } func updateItems(transactions: [DSTransaction]) { Task.detached { diff --git a/DashWallet/Sources/UI/SwiftUI Components/Color+DWStyle.swift b/DashWallet/Sources/UI/SwiftUI Components/Color+DWStyle.swift index c424f8a2a..1ac7c567b 100644 --- a/DashWallet/Sources/UI/SwiftUI Components/Color+DWStyle.swift +++ b/DashWallet/Sources/UI/SwiftUI Components/Color+DWStyle.swift @@ -34,6 +34,10 @@ extension Color { Color("DashBlueColor") } + static var navigationBarColor: Color { + Color("DashNavigationBarBlueColor") + } + static var buttonRed: Color { Color("ButtonRedColor") }