Adjust onboarding header to short step label and top-align step content
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
"onboarding_welcome_step_4" = "Add your usual dishes to start fast";
|
"onboarding_welcome_step_4" = "Add your usual dishes to start fast";
|
||||||
"onboarding_nav_intro" = "Quick setup";
|
"onboarding_nav_intro" = "Quick setup";
|
||||||
"onboarding_nav_setup" = "Setup";
|
"onboarding_nav_setup" = "Setup";
|
||||||
|
"onboarding_nav_step_short" = "Step %d";
|
||||||
"onboarding_nav_step_counter" = "Step %d/%d";
|
"onboarding_nav_step_counter" = "Step %d/%d";
|
||||||
"onboarding_start" = "Get Started";
|
"onboarding_start" = "Get Started";
|
||||||
"onboarding_continue" = "Continue";
|
"onboarding_continue" = "Continue";
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"onboarding_welcome_step_4" = "Añade tus platos habituales para empezar rápido";
|
"onboarding_welcome_step_4" = "Añade tus platos habituales para empezar rápido";
|
||||||
"onboarding_nav_intro" = "Configuración rápida";
|
"onboarding_nav_intro" = "Configuración rápida";
|
||||||
"onboarding_nav_setup" = "Config";
|
"onboarding_nav_setup" = "Config";
|
||||||
|
"onboarding_nav_step_short" = "Paso %d";
|
||||||
"onboarding_nav_step_counter" = "Paso %d/%d";
|
"onboarding_nav_step_counter" = "Paso %d/%d";
|
||||||
"onboarding_start" = "Comenzar";
|
"onboarding_start" = "Comenzar";
|
||||||
"onboarding_continue" = "Continuar";
|
"onboarding_continue" = "Continuar";
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ struct CalendarStepView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VStack(spacing: 24) {
|
VStack(spacing: 24) {
|
||||||
|
Text("calendar_title")
|
||||||
|
.font(.mealMoodH1)
|
||||||
|
.foregroundColor(.mealMoodTextPrimary)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.top, 12)
|
||||||
|
|
||||||
VStack(spacing: 16) {
|
VStack(spacing: 16) {
|
||||||
// iCloud sync toggle
|
// iCloud sync toggle
|
||||||
HStack {
|
HStack {
|
||||||
@@ -115,7 +123,6 @@ struct CalendarStepView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 24)
|
.padding(.horizontal, 24)
|
||||||
.padding(.top, 24)
|
|
||||||
|
|
||||||
Text("calendar_optional")
|
Text("calendar_optional")
|
||||||
.font(.mealMoodSmall)
|
.font(.mealMoodSmall)
|
||||||
|
|||||||
@@ -34,12 +34,18 @@ struct FirstDishesStepView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VStack(spacing: 24) {
|
VStack(spacing: 24) {
|
||||||
|
Text("first_dishes_title")
|
||||||
|
.font(.mealMoodH1)
|
||||||
|
.foregroundColor(.mealMoodTextPrimary)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.top, 12)
|
||||||
|
|
||||||
Text("first_dishes_subtitle")
|
Text("first_dishes_subtitle")
|
||||||
.font(.mealMoodSmall)
|
.font(.mealMoodSmall)
|
||||||
.foregroundColor(.mealMoodTextSecondary)
|
.foregroundColor(.mealMoodTextSecondary)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.padding(.horizontal, 24)
|
.padding(.horizontal, 24)
|
||||||
.padding(.top, 20)
|
|
||||||
|
|
||||||
// New dish form
|
// New dish form
|
||||||
VStack(spacing: 12) {
|
VStack(spacing: 12) {
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ struct MealWindowsStepView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 24) {
|
VStack(spacing: 24) {
|
||||||
Spacer()
|
Text("meal_windows_title")
|
||||||
|
.font(.mealMoodH1)
|
||||||
|
.foregroundColor(.mealMoodTextPrimary)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.top, 12)
|
||||||
|
|
||||||
VStack(spacing: 12) {
|
VStack(spacing: 12) {
|
||||||
ForEach(MealWindows.allCases, id: \.self) { option in
|
ForEach(MealWindows.allCases, id: \.self) { option in
|
||||||
@@ -24,10 +30,9 @@ struct MealWindowsStepView: View {
|
|||||||
}
|
}
|
||||||
.padding(.horizontal, 24)
|
.padding(.horizontal, 24)
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
PrimaryButton(title: String(localized: "onboarding_continue"), action: onNext)
|
PrimaryButton(title: String(localized: "onboarding_continue"), action: onNext)
|
||||||
.padding(.horizontal, 24)
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.top, 8)
|
||||||
.padding(.bottom, 40)
|
.padding(.bottom, 40)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ struct OnboardingView: View {
|
|||||||
}
|
}
|
||||||
.tabViewStyle(.page(indexDisplayMode: .never))
|
.tabViewStyle(.page(indexDisplayMode: .never))
|
||||||
.animation(.easeInOut(duration: 0.3), value: viewModel.currentStep)
|
.animation(.easeInOut(duration: 0.3), value: viewModel.currentStep)
|
||||||
.frame(maxHeight: .infinity, alignment: .center)
|
.frame(maxHeight: .infinity, alignment: .top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
@@ -147,14 +147,8 @@ struct OnboardingView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var headerTitle: String {
|
private var headerTitle: String {
|
||||||
switch viewModel.currentStep {
|
guard viewModel.currentStep > 0 else { return String(localized: "onboarding_nav_intro") }
|
||||||
case 0: return String(localized: "onboarding_nav_intro")
|
return String(format: String(localized: "onboarding_nav_step_short"), viewModel.currentStep)
|
||||||
case 1: return String(localized: "meal_windows_title")
|
|
||||||
case 2: return String(localized: "weekends_title")
|
|
||||||
case 3: return String(localized: "calendar_title")
|
|
||||||
case 4: return String(localized: "first_dishes_title")
|
|
||||||
default: return ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var stepCounterText: String {
|
private var stepCounterText: String {
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ struct WeekendsStepView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 24) {
|
VStack(spacing: 24) {
|
||||||
Spacer()
|
Text("weekends_title")
|
||||||
|
.font(.mealMoodH1)
|
||||||
|
.foregroundColor(.mealMoodTextPrimary)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.top, 12)
|
||||||
|
|
||||||
VStack(spacing: 16) {
|
VStack(spacing: 16) {
|
||||||
HStack {
|
HStack {
|
||||||
@@ -34,10 +40,9 @@ struct WeekendsStepView: View {
|
|||||||
.font(.mealMoodSmall)
|
.font(.mealMoodSmall)
|
||||||
.foregroundColor(.mealMoodTextSecondary)
|
.foregroundColor(.mealMoodTextSecondary)
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
PrimaryButton(title: String(localized: "onboarding_continue"), action: onNext)
|
PrimaryButton(title: String(localized: "onboarding_continue"), action: onNext)
|
||||||
.padding(.horizontal, 24)
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.top, 8)
|
||||||
.padding(.bottom, 40)
|
.padding(.bottom, 40)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user