From ba50eb83197087bbafb358628f2548d78f883832 Mon Sep 17 00:00:00 2001 From: Huong Do Date: Thu, 12 Sep 2024 16:13:06 +0700 Subject: [PATCH 1/3] Push the footer to the bottom --- .../BlazeCampaignObjectivePickerView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift b/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift index dbd195feb0b..e1d667760d0 100644 --- a/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift +++ b/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift @@ -17,12 +17,15 @@ struct BlazeCampaignObjectivePickerView: View { var body: some View { NavigationStack { - Group { + VStack { if viewModel.fetchedData.isNotEmpty { optionList } else if viewModel.isSyncingData { + Spacer() ActivityIndicator(isAnimating: .constant(true), style: .medium) + Spacer() } else if viewModel.syncError != nil { + Spacer() ErrorStateView(title: Localization.errorMessage, image: .errorImage, actionTitle: Localization.tryAgain, @@ -31,6 +34,7 @@ struct BlazeCampaignObjectivePickerView: View { await viewModel.syncData() } }) + Spacer() } } .navigationBarTitleDisplayMode(.inline) From ceae6ef3f25af8ab791db907dba58a18ee645345 Mon Sep 17 00:00:00 2001 From: Huong Do Date: Thu, 12 Sep 2024 16:40:11 +0700 Subject: [PATCH 2/3] Align error message to the center --- .../CampaignObjectives/BlazeCampaignObjectivePickerView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift b/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift index e1d667760d0..3a976cdcd40 100644 --- a/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift +++ b/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift @@ -34,6 +34,7 @@ struct BlazeCampaignObjectivePickerView: View { await viewModel.syncData() } }) + .multilineTextAlignment(.center) Spacer() } } From 00e1db3dd43872edecb79dedeafa1dad8d6c579d Mon Sep 17 00:00:00 2001 From: Huong Do Date: Thu, 12 Sep 2024 16:47:02 +0700 Subject: [PATCH 3/3] Set max height instead of VStack with spacer --- .../BlazeCampaignObjectivePickerView.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift b/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift index 3a976cdcd40..28e7f7fda2e 100644 --- a/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift +++ b/WooCommerce/Classes/ViewRelated/Blaze/CampaignObjectives/BlazeCampaignObjectivePickerView.swift @@ -17,15 +17,12 @@ struct BlazeCampaignObjectivePickerView: View { var body: some View { NavigationStack { - VStack { + Group { if viewModel.fetchedData.isNotEmpty { optionList } else if viewModel.isSyncingData { - Spacer() ActivityIndicator(isAnimating: .constant(true), style: .medium) - Spacer() } else if viewModel.syncError != nil { - Spacer() ErrorStateView(title: Localization.errorMessage, image: .errorImage, actionTitle: Localization.tryAgain, @@ -35,9 +32,9 @@ struct BlazeCampaignObjectivePickerView: View { } }) .multilineTextAlignment(.center) - Spacer() } } + .frame(maxHeight: .infinity) .navigationBarTitleDisplayMode(.inline) .navigationTitle(Localization.title) .toolbar {