Integrate onboarding to fake home

show OnboadingScreen instead of  OnboardingView

remove Struct Type
This commit is contained in:
Francisco Gindre 2021-12-08 16:18:08 -03:00
parent c702319bb5
commit 3422c8dbd0
3 changed files with 33 additions and 4 deletions

View File

@ -106,8 +106,8 @@
F9C165C02740403600592F76 /* ApproveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9C165B92740403600592F76 /* ApproveView.swift */; };
F9C165C22740403600592F76 /* CreateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9C165BB2740403600592F76 /* CreateView.swift */; };
F9C165C42740403600592F76 /* SentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9C165BD2740403600592F76 /* SentView.swift */; };
F9EEB8162742C2210032EEB8 /* WithStateBinding.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */; };
F9C165CB2741AB5D00592F76 /* SendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9C165CA2741AB5D00592F76 /* SendView.swift */; };
F9EEB8162742C2210032EEB8 /* WithStateBinding.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -233,8 +233,8 @@
F9C165B92740403600592F76 /* ApproveView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApproveView.swift; sourceTree = "<group>"; };
F9C165BB2740403600592F76 /* CreateView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateView.swift; sourceTree = "<group>"; };
F9C165BD2740403600592F76 /* SentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentView.swift; sourceTree = "<group>"; };
F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithStateBinding.swift; sourceTree = "<group>"; };
F9C165CA2741AB5D00592F76 /* SendView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendView.swift; sourceTree = "<group>"; };
F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithStateBinding.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -1194,7 +1194,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "\"secant/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
@ -1218,7 +1218,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "\"secant/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;

View File

@ -5,6 +5,7 @@ struct HomeState: Equatable {
enum Route: Equatable {
case history
case send
case onboarding
}
var transactionHistoryState: TransactionHistoryState
var route: Route?
@ -98,4 +99,13 @@ extension HomeViewStore {
}
)
}
var showOnboardingBinding: Binding<Bool> {
self.binding(
get: {$0.route == .onboarding },
send: { isActive in
return .updateRoute(isActive ? .onboarding : nil)
}
)
}
}

View File

@ -28,6 +28,13 @@ struct HomeView: View {
.primaryButtonStyle
.frame(height: 50)
Button(
action: { viewStore.send(.updateRoute(.onboarding)) },
label: { Text("Show Onboarding") }
)
.primaryButtonStyle
.frame(height: 50)
Spacer()
HStack {
@ -64,6 +71,18 @@ struct HomeView: View {
)
}
)
.navigationLinkEmpty(
isActive: viewStore.showOnboardingBinding,
destination: {
OnboardingScreen(
store: Store(
initialState: OnboardingState(),
reducer: .default,
environment: ()
)
)
}
)
.fullScreenCover(
isPresented: viewStore.showHistoryBinding,
content: {