Skip to content

Commit

Permalink
Fix end of journey dialog CTA title
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandroboron committed Oct 30, 2024
1 parent f0ee135 commit 439863f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -322,6 +322,7 @@ struct OnboardingAddToDockTutorialContent: View {
OnboardingFinalDialog(
logoPosition: .top,
message: UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenMessage,
cta: UserText.DaxOnboardingExperiment.ContextualOnboarding.onboardingFinalScreenButton,
canShowAddToDockTutorial: false,
dismissAction: { _ in }
)
Expand All @@ -332,6 +333,7 @@ struct OnboardingAddToDockTutorialContent: View {
OnboardingFinalDialog(
logoPosition: .left,
message: UserText.AddToDockOnboarding.EndOfJourney.message,
cta: UserText.AddToDockOnboarding.Buttons.dismiss,
canShowAddToDockTutorial: true,
dismissAction: { _ in }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 439863f

Please sign in to comment.