- draft of the removal, home screen updated [#559] Remove the circular progress bar from home screen - circular area removed - snapshot tests of the circular area removed - home screen simplified
This commit is contained in:
parent
60f19a360d
commit
1988d30540
|
@ -397,7 +397,6 @@
|
|||
9E612C7629880FC900D09B09 /* LogsHandlerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E612C7529880FC900D09B09 /* LogsHandlerTest.swift */; };
|
||||
9E612C7929913F3600D09B09 /* SensitiveDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E612C7829913F3600D09B09 /* SensitiveDataTests.swift */; };
|
||||
9E612C7E2991491200D09B09 /* SensitiveData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E612C7C2991476F00D09B09 /* SensitiveData.swift */; };
|
||||
9E66122A287717A900C75B70 /* HomeCircularProgressSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E661229287717A900C75B70 /* HomeCircularProgressSnapshotTests.swift */; };
|
||||
9E66122C2877188700C75B70 /* SyncStatusSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */; };
|
||||
9E6612312878337F00C75B70 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 9E6612302878337F00C75B70 /* Lottie */; };
|
||||
9E6612332878338C00C75B70 /* LottieAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E6612322878338C00C75B70 /* LottieAnimation.swift */; };
|
||||
|
@ -712,7 +711,6 @@
|
|||
9E612C7529880FC900D09B09 /* LogsHandlerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogsHandlerTest.swift; sourceTree = "<group>"; };
|
||||
9E612C7829913F3600D09B09 /* SensitiveDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SensitiveDataTests.swift; sourceTree = "<group>"; };
|
||||
9E612C7C2991476F00D09B09 /* SensitiveData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SensitiveData.swift; sourceTree = "<group>"; };
|
||||
9E661229287717A900C75B70 /* HomeCircularProgressSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeCircularProgressSnapshotTests.swift; sourceTree = "<group>"; };
|
||||
9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncStatusSnapshot.swift; sourceTree = "<group>"; };
|
||||
9E6612322878338C00C75B70 /* LottieAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LottieAnimation.swift; sourceTree = "<group>"; };
|
||||
9E6612352878345000C75B70 /* endlessCircleProgress.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = endlessCircleProgress.json; sourceTree = "<group>"; };
|
||||
|
@ -1727,7 +1725,6 @@
|
|||
9E9ECC8B28589E150099D5A2 /* HomeSnapshotTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9E661229287717A900C75B70 /* HomeCircularProgressSnapshotTests.swift */,
|
||||
9E9ECC8C28589E150099D5A2 /* HomeSnapshotTests.swift */,
|
||||
3448CB3628E485CB006ADEDB /* NotEnoughFeeSpaceSnapshots.swift */,
|
||||
);
|
||||
|
@ -2983,7 +2980,6 @@
|
|||
9E5BF63F2819542C00BA3F17 /* WalletEventsTests.swift in Sources */,
|
||||
0D4E7A1B26B364180058B01E /* secantTests.swift in Sources */,
|
||||
0DFE93E6272CB6F7000FCCA5 /* RecoveryPhraseValidationTests.swift in Sources */,
|
||||
9E66122A287717A900C75B70 /* HomeCircularProgressSnapshotTests.swift in Sources */,
|
||||
9EAB4676285B5C7C002904A0 /* DeeplinkTests.swift in Sources */,
|
||||
9E207C362966EC77003E2C9B /* AddressDetailsSnapshotTests.swift in Sources */,
|
||||
9E3911392848AD500073DD9A /* HomeTests.swift in Sources */,
|
||||
|
|
|
@ -13,17 +13,16 @@ struct HomeReducer: ReducerProtocol {
|
|||
|
||||
struct State: Equatable {
|
||||
enum Destination: Equatable {
|
||||
case balanceBreakdown
|
||||
case notEnoughFreeDiskSpace
|
||||
case profile
|
||||
case request
|
||||
case transactionHistory
|
||||
case send
|
||||
case balanceBreakdown
|
||||
case transactionHistory
|
||||
}
|
||||
|
||||
var destination: Destination?
|
||||
|
||||
var balanceBreakdownState: BalanceBreakdownReducer.State
|
||||
var destination: Destination?
|
||||
var profileState: ProfileReducer.State
|
||||
var requestState: RequestReducer.State
|
||||
var requiredTransactionConfirmations = 0
|
||||
|
|
|
@ -7,13 +7,17 @@ struct HomeView: View {
|
|||
var body: some View {
|
||||
WithViewStore(store) { viewStore in
|
||||
VStack {
|
||||
ZStack {
|
||||
HStack {
|
||||
profileButton(viewStore)
|
||||
|
||||
circularArea(viewStore)
|
||||
Spacer()
|
||||
}
|
||||
|
||||
balance(viewStore)
|
||||
|
||||
Spacer()
|
||||
|
||||
sendButton(viewStore)
|
||||
}
|
||||
|
||||
Button {
|
||||
viewStore.send(.updateDestination(.transactionHistory))
|
||||
|
@ -44,10 +48,6 @@ struct HomeView: View {
|
|||
|
||||
extension HomeView {
|
||||
func profileButton(_ viewStore: HomeViewStore) -> some View {
|
||||
VStack {
|
||||
HStack {
|
||||
Spacer()
|
||||
|
||||
Image(Asset.Assets.Icons.profile.name)
|
||||
.resizable()
|
||||
.frame(width: 60, height: 60)
|
||||
|
@ -60,14 +60,7 @@ extension HomeView {
|
|||
)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
|
||||
func sendButton(_ viewStore: HomeViewStore) -> some View {
|
||||
VStack {
|
||||
Spacer()
|
||||
|
||||
Text("Send")
|
||||
.shadow(color: Asset.Colors.Buttons.buttonsTitleShadow.color, radius: 2, x: 0, y: 2)
|
||||
.frame(
|
||||
|
@ -88,36 +81,22 @@ extension HomeView {
|
|||
SendFlowView(store: store.sendStore())
|
||||
}
|
||||
)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding(.bottom, 30)
|
||||
}
|
||||
|
||||
func circularArea(_ viewStore: HomeViewStore) -> some View {
|
||||
VStack {
|
||||
ZStack {
|
||||
CircularProgress(
|
||||
outerCircleProgress: viewStore.isSyncing ? 0 : viewStore.synchronizerStatusSnapshot.progress,
|
||||
innerCircleProgress: 1,
|
||||
maxSegments: viewStore.requiredTransactionConfirmations,
|
||||
innerCircleHidden: viewStore.isUpToDate
|
||||
)
|
||||
.padding(.top, 50)
|
||||
|
||||
VStack {
|
||||
func balance(_ viewStore: HomeViewStore) -> some View {
|
||||
Group {
|
||||
Button {
|
||||
viewStore.send(.updateDestination(.balanceBreakdown))
|
||||
} label: {
|
||||
Text("$\(viewStore.shieldedBalance.data.total.decimalString())")
|
||||
.font(.custom(FontFamily.Zboto.regular.name, size: 40))
|
||||
.foregroundColor(Asset.Colors.Text.balanceText.color)
|
||||
.padding(.top, 80)
|
||||
}
|
||||
|
||||
Text("$\(viewStore.totalCurrencyBalance.decimalString())")
|
||||
.font(.custom(FontFamily.Rubik.regular.name, size: 13))
|
||||
.opacity(0.6)
|
||||
.padding(.bottom, 50)
|
||||
|
||||
Text("\(viewStore.synchronizerStatusSnapshot.message)")
|
||||
.accessDebugMenuWithHiddenGesture {
|
||||
|
@ -125,10 +104,6 @@ extension HomeView {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
|
|
@ -90,8 +90,8 @@ class HomeTests: XCTestCase {
|
|||
|
||||
@MainActor func testQuickRescan_ResetToHomeScreen() async throws {
|
||||
let homeState = HomeReducer.State(
|
||||
destination: .profile,
|
||||
balanceBreakdownState: .placeholder,
|
||||
destination: .profile,
|
||||
profileState: .placeholder,
|
||||
requestState: .placeholder,
|
||||
scanState: .placeholder,
|
||||
|
@ -115,8 +115,8 @@ class HomeTests: XCTestCase {
|
|||
|
||||
@MainActor func testFullRescan_ResetToHomeScreen() async throws {
|
||||
let homeState = HomeReducer.State(
|
||||
destination: .profile,
|
||||
balanceBreakdownState: .placeholder,
|
||||
destination: .profile,
|
||||
profileState: .placeholder,
|
||||
requestState: .placeholder,
|
||||
scanState: .placeholder,
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
//
|
||||
// HomeCircularProgressSnapshotTests.swift
|
||||
// secantTests
|
||||
//
|
||||
// Created by Lukáš Korba on 07.07.2022.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import ComposableArchitecture
|
||||
@testable import secant_testnet
|
||||
@testable import ZcashLightClientKit
|
||||
|
||||
class HomeCircularProgressSnapshotTests: XCTestCase {
|
||||
func testCircularProgress_DownloadingInnerCircle() throws {
|
||||
class SnapshotNoopSDKSynchronizer: NoopSDKSynchronizer {
|
||||
// heights purposely set so we visually see 55% progress
|
||||
override func statusSnapshot() -> SyncStatusSnapshot {
|
||||
let blockProgress = BlockProgress(
|
||||
startHeight: BlockHeight(0),
|
||||
targetHeight: BlockHeight(100),
|
||||
progressHeight: BlockHeight(55)
|
||||
)
|
||||
|
||||
return SyncStatusSnapshot.snapshotFor(state: .syncing(blockProgress))
|
||||
}
|
||||
}
|
||||
|
||||
let balance = WalletBalance(verified: Zatoshi(15_345_000), total: Zatoshi(15_345_000))
|
||||
|
||||
let store = HomeStore(
|
||||
initialState: .init(
|
||||
balanceBreakdownState: .placeholder,
|
||||
profileState: .placeholder,
|
||||
requestState: .placeholder,
|
||||
scanState: .placeholder,
|
||||
sendState: .placeholder,
|
||||
shieldedBalance: balance.redacted,
|
||||
synchronizerStatusSnapshot: .default,
|
||||
walletEventsState: .emptyPlaceHolder
|
||||
),
|
||||
reducer: HomeReducer()
|
||||
.dependency(\.diskSpaceChecker, .mockEmptyDisk)
|
||||
.dependency(\.sdkSynchronizer, SnapshotNoopSDKSynchronizer())
|
||||
)
|
||||
|
||||
addAttachments(HomeView(store: store))
|
||||
}
|
||||
|
||||
func testCircularProgress_ScanningOuterCircle() throws {
|
||||
class SnapshotNoopSDKSynchronizer: NoopSDKSynchronizer {
|
||||
override func statusSnapshot() -> SyncStatusSnapshot {
|
||||
// heights purposely set so we visually see 72% progress
|
||||
let blockProgress = BlockProgress(
|
||||
startHeight: BlockHeight(0),
|
||||
targetHeight: BlockHeight(100),
|
||||
progressHeight: BlockHeight(72)
|
||||
)
|
||||
|
||||
return SyncStatusSnapshot.snapshotFor(state: .syncing(blockProgress))
|
||||
}
|
||||
}
|
||||
|
||||
let balance = WalletBalance(verified: 15_345_000, total: 15_345_000)
|
||||
|
||||
let store = HomeStore(
|
||||
initialState: .init(
|
||||
balanceBreakdownState: .placeholder,
|
||||
profileState: .placeholder,
|
||||
requestState: .placeholder,
|
||||
scanState: .placeholder,
|
||||
sendState: .placeholder,
|
||||
shieldedBalance: balance.redacted,
|
||||
synchronizerStatusSnapshot: .default,
|
||||
walletEventsState: .emptyPlaceHolder
|
||||
),
|
||||
reducer: HomeReducer()
|
||||
.dependency(\.diskSpaceChecker, .mockEmptyDisk)
|
||||
)
|
||||
|
||||
addAttachments(HomeView(store: store))
|
||||
}
|
||||
|
||||
func testCircularProgress_UpToDateOnlyOuterCircle() throws {
|
||||
class SnapshotNoopSDKSynchronizer: NoopSDKSynchronizer {
|
||||
override func statusSnapshot() -> SyncStatusSnapshot {
|
||||
SyncStatusSnapshot.snapshotFor(state: .synced)
|
||||
}
|
||||
}
|
||||
|
||||
let balance = WalletBalance(verified: 15_345_000, total: 15_345_000)
|
||||
|
||||
let store = HomeStore(
|
||||
initialState: .init(
|
||||
balanceBreakdownState: .placeholder,
|
||||
profileState: .placeholder,
|
||||
requestState: .placeholder,
|
||||
scanState: .placeholder,
|
||||
sendState: .placeholder,
|
||||
shieldedBalance: balance.redacted,
|
||||
synchronizerStatusSnapshot: .default,
|
||||
walletEventsState: .emptyPlaceHolder
|
||||
),
|
||||
reducer: HomeReducer()
|
||||
.dependency(\.diskSpaceChecker, .mockEmptyDisk)
|
||||
)
|
||||
|
||||
addAttachments(HomeView(store: store))
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue