[logged-out-auth-intro] Embed login flow directly in logged-out profile tab
This commit is contained in:
@@ -2,7 +2,11 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>aps-environment</key>
|
||||||
|
<string>development</string>
|
||||||
<key>com.apple.developer.devicecheck.appattest-environment</key>
|
<key>com.apple.developer.devicecheck.appattest-environment</key>
|
||||||
<string>development</string>
|
<string>development</string>
|
||||||
|
<key>com.apple.developer.location.push</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@
|
|||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = "Pedi Foods";
|
INFOPLIST_KEY_CFBundleDisplayName = "Pedi Foods";
|
||||||
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
||||||
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "PediFoods uses your location to show nearby stores and estimate delivery times.";
|
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "PediFoods usa sua localização para mostrar lojas perto de você";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||||
@@ -196,17 +196,17 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 496EB72F2A6AE4DE00C1253B /* PediFoods.xcconfig */;
|
baseConfigurationReference = 496EB72F2A6AE4DE00C1253B /* PediFoods.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_IDENTITY = "Apple Distribution";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = K4E5BZMM4V;
|
DEVELOPMENT_TEAM = K4E5BZMM4V;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = "Pedi Foods";
|
INFOPLIST_KEY_CFBundleDisplayName = "Pedi Foods";
|
||||||
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
||||||
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "PediFoods uses your location to show nearby stores and estimate delivery times.";
|
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "PediFoods usa sua localização para mostrar lojas perto de você";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "com.br.pedifoods.app AppStore";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
TARGETED_DEVICE_FAMILY = 1;
|
TARGETED_DEVICE_FAMILY = 1;
|
||||||
|
|||||||
@@ -456,12 +456,6 @@
|
|||||||
"Entrar" : {
|
"Entrar" : {
|
||||||
"comment" : "A link that directs the user to the login screen.",
|
"comment" : "A link that directs the user to the login screen.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
},
|
|
||||||
"Entrar ou Cadastrar" : {
|
|
||||||
|
|
||||||
},
|
|
||||||
"Entre na sua conta" : {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
"Entrega" : {
|
"Entrega" : {
|
||||||
"comment" : "A text describing delivery mode.",
|
"comment" : "A text describing delivery mode.",
|
||||||
@@ -514,9 +508,6 @@
|
|||||||
},
|
},
|
||||||
"Excluir sua conta?" : {
|
"Excluir sua conta?" : {
|
||||||
|
|
||||||
},
|
|
||||||
"Faça login ou cadastre-se para ver seu perfil, pedidos e endereços." : {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
"Favorite" : {
|
"Favorite" : {
|
||||||
"comment" : "Item editor title label for marking the item as a favorite",
|
"comment" : "Item editor title label for marking the item as a favorite",
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ struct MainTabView: View {
|
|||||||
CartView(appState: $appState, selectedTab: $selectedTab, root: $root)
|
CartView(appState: $appState, selectedTab: $selectedTab, root: $root)
|
||||||
}
|
}
|
||||||
case .profile:
|
case .profile:
|
||||||
NavigationStack {
|
if appState.session.isAuthenticated {
|
||||||
if appState.session.isAuthenticated {
|
NavigationStack {
|
||||||
ProfileView(root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState)
|
ProfileView(root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState)
|
||||||
} else {
|
|
||||||
ProfileLoggedOutView(root: $root)
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ProfileLoggedOutView(root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -312,45 +312,39 @@ struct ProfileView: View {
|
|||||||
|
|
||||||
struct ProfileLoggedOutView: View {
|
struct ProfileLoggedOutView: View {
|
||||||
@Binding var root: RootFlow
|
@Binding var root: RootFlow
|
||||||
|
@Binding var selectedTab: MainTab
|
||||||
|
let tokenStore: TokenStore
|
||||||
|
@Binding var appState: AppState
|
||||||
|
@State private var path: [Route] = []
|
||||||
|
@State private var entryAnimationToken = 0
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 18) {
|
NavigationStack(path: $path) {
|
||||||
Spacer()
|
LoginView(
|
||||||
|
root: $root,
|
||||||
Image(systemName: "person.crop.circle.badge.questionmark")
|
selectedTab: $selectedTab,
|
||||||
.font(.system(size: 56, weight: .regular))
|
tokenStore: tokenStore,
|
||||||
.foregroundStyle(AppColors.textMuted)
|
appState: $appState,
|
||||||
|
shouldPrepareEntryAnimation: true,
|
||||||
Text("Entre na sua conta")
|
authEntryAnimationToken: entryAnimationToken,
|
||||||
.font(AppTypography.heading2)
|
navigate: { route in path.append(route) }
|
||||||
.foregroundStyle(AppColors.textPrimary)
|
)
|
||||||
|
.onAppear { entryAnimationToken += 1 }
|
||||||
Text("Faça login ou cadastre-se para ver seu perfil, pedidos e endereços.")
|
.navigationDestination(for: Route.self) { route in
|
||||||
.font(AppTypography.body)
|
switch route {
|
||||||
.foregroundStyle(AppColors.textMuted)
|
case .terms:
|
||||||
.multilineTextAlignment(.center)
|
TermsOfUseView()
|
||||||
.padding(.horizontal, 32)
|
case .policy:
|
||||||
|
PrivacyPolicyView()
|
||||||
Button {
|
case .registration:
|
||||||
root = .auth
|
RegistrationView(root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState, navigate: { route in path.append(route) })
|
||||||
} label: {
|
case .loginEmail:
|
||||||
Text("Entrar ou Cadastrar")
|
LoginEmailView(root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState, navigate: { route in path.append(route) })
|
||||||
.font(AppTypography.heading3)
|
case .otp(let email, let phoneNumber):
|
||||||
.foregroundStyle(AppColors.textInverse)
|
OtpView(email: email, phoneNumber: phoneNumber, root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState)
|
||||||
.frame(maxWidth: .infinity)
|
}
|
||||||
.padding(.vertical, 14)
|
|
||||||
.background(AppColors.primary)
|
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous))
|
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
|
||||||
.padding(.horizontal, 32)
|
|
||||||
.padding(.top, 8)
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
Spacer()
|
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
||||||
.background(AppColors.backgroundLight)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user