From 439863ff07788506ed6156360443be221351dab9 Mon Sep 17 00:00:00 2001 From: Alessandro Boron Date: Wed, 30 Oct 2024 14:48:04 +0100 Subject: [PATCH] Fix end of journey dialog CTA title --- .../ContextualOnboardingDialogs.swift | 4 +++- .../ContextualDaxDialogs/NewTabDaxDialogFactory.swift | 11 +++++++---- .../ContextualDaxDialogsFactory.swift | 11 +++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/ContextualOnboardingDialogs.swift b/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/ContextualOnboardingDialogs.swift index f5bb5d47ec..f7f72be026 100644 --- a/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/ContextualOnboardingDialogs.swift +++ b/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/ContextualOnboardingDialogs.swift @@ -185,10 +185,10 @@ struct OnboardingTrackersDoneDialog: View { struct OnboardingFinalDialog: View { let title = UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenTitle - let cta = UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenButton let logoPosition: DaxDialogLogoPosition let message: String + let cta: String let canShowAddToDockTutorial: Bool let dismissAction: (_ fromAddToDock: Bool) -> Void @@ -322,6 +322,7 @@ struct OnboardingAddToDockTutorialContent: View { OnboardingFinalDialog( logoPosition: .top, message: UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage, + cta: UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenButton, canShowAddToDockTutorial: false, dismissAction: { _ in } ) @@ -332,6 +333,7 @@ struct OnboardingAddToDockTutorialContent: View { OnboardingFinalDialog( logoPosition: .left, message: UserText.AddToDockOnboarding.EndOfJourney.message, + cta: UserText.AddToDockOnboarding.Buttons.dismiss, canShowAddToDockTutorial: true, dismissAction: { _ in } ) diff --git a/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/NewTabDaxDialogFactory.swift b/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/NewTabDaxDialogFactory.swift index c4f74f8217..ece536eaa6 100644 --- a/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/NewTabDaxDialogFactory.swift +++ b/DuckDuckGo/OnboardingExperiment/ContextualDaxDialogs/NewTabDaxDialogFactory.swift @@ -99,14 +99,17 @@ final class NewTabDaxDialogFactory: NewTabDaxDialogProvider { } private func createFinalDialog(onDismiss: @escaping () -> Void) -> some View { - let message = if onboardingManager.isAddToDockEnabled { - UserText.AddToDockOnboarding.EndOfJourney.message + let (message, cta) = if onboardingManager.isAddToDockEnabled { + (UserText.AddToDockOnboarding.EndOfJourney.message, UserText.AddToDockOnboarding.Buttons.dismiss) } else { - onboardingManager.isOnboardingHighlightsEnabled ? UserText.HighlightsOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage : UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage + ( + onboardingManager.isOnboardingHighlightsEnabled ? UserText.HighlightsOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage : UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage, + UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenButton + ) } return FadeInView { - OnboardingFinalDialog(logoPosition: .top, message: message, canShowAddToDockTutorial: onboardingManager.isAddToDockEnabled) { [weak self] isDismissedFromAddToDock in + OnboardingFinalDialog(logoPosition: .top, message: message, cta: cta, canShowAddToDockTutorial: onboardingManager.isAddToDockEnabled) { [weak self] isDismissedFromAddToDock in if isDismissedFromAddToDock { Logger.onboarding.debug("Dismissed from add to dock") } else { diff --git a/DuckDuckGo/OnboardingExperiment/ContextualOnboarding/ContextualDaxDialogsFactory.swift b/DuckDuckGo/OnboardingExperiment/ContextualOnboarding/ContextualDaxDialogsFactory.swift index b6b9f08289..c2312aad52 100644 --- a/DuckDuckGo/OnboardingExperiment/ContextualOnboarding/ContextualDaxDialogsFactory.swift +++ b/DuckDuckGo/OnboardingExperiment/ContextualOnboarding/ContextualDaxDialogsFactory.swift @@ -182,13 +182,16 @@ final class ExperimentContextualDaxDialogsFactory: ContextualDaxDialogsFactory { } private func endOfJourneyDialog(delegate: ContextualOnboardingDelegate, pixelName: Pixel.Event) -> some View { - let message = if onboardingManager.isAddToDockEnabled { - UserText.AddToDockOnboarding.EndOfJourney.message + let (message, cta) = if onboardingManager.isAddToDockEnabled { + (UserText.AddToDockOnboarding.EndOfJourney.message, UserText.AddToDockOnboarding.Buttons.dismiss) } else { - onboardingManager.isOnboardingHighlightsEnabled ? UserText.HighlightsOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage : UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage + ( + onboardingManager.isOnboardingHighlightsEnabled ? UserText.HighlightsOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage : UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage, + UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenButton + ) } - return OnboardingFinalDialog(logoPosition: .left, message: message, canShowAddToDockTutorial: onboardingManager.isAddToDockEnabled, dismissAction: { [weak delegate, weak self] isDismissedFromAddToDock in + return OnboardingFinalDialog(logoPosition: .left, message: message, cta: cta, canShowAddToDockTutorial: onboardingManager.isAddToDockEnabled, dismissAction: { [weak delegate, weak self] isDismissedFromAddToDock in delegate?.didTapDismissContextualOnboardingAction() if isDismissedFromAddToDock { Logger.onboarding.debug("Dismissed from add to dock")