@@ -36,11 +36,9 @@ struct JetpackFullscreenOverlayGeneralViewModel: JetpackFullscreenOverlayViewMod
3636 case ( . four, . appOpen) :
3737 return true
3838
39- // New Users Phase: Show feature-collection overlays. Do not show on app-open. Features are removed by this point so they are irrelevant.
40- case ( . newUsers, . appOpen) :
41- return false
39+ // New Users Phase: Show feature-collection overlays. Features are removed by this point so they are irrelevant.
4240 case ( . newUsers, _) :
43- return false // TODO: Change this to true when other new users phase tasks are ready
41+ return true
4442
4543 default :
4644 return false
@@ -79,6 +77,10 @@ struct JetpackFullscreenOverlayGeneralViewModel: JetpackFullscreenOverlayViewMod
7977 case ( . four, _) :
8078 return Strings . PhaseFour. generalTitle
8179
80+ // New Users
81+ case ( . newUsers, _) :
82+ return Strings . NewUsers. generalTitle
83+
8284 default :
8385 return " "
8486 }
@@ -105,41 +107,49 @@ struct JetpackFullscreenOverlayGeneralViewModel: JetpackFullscreenOverlayViewMod
105107 // Phase Four
106108 case ( . four, _) :
107109 return . init( string: Strings . PhaseFour. subtitle)
110+
111+ // New Users
112+ case ( . newUsers, _) :
113+ return . init( string: Strings . NewUsers. subtitle)
108114 default :
109115 return . init( string: " " )
110116 }
111117 }
112118
113119 var animationLtr : String {
114- switch source {
115- case . stats:
120+ switch ( source, phase ) {
121+ case ( . stats, _ ) :
116122 return Constants . statsLogoAnimationLtr
117- case . notifications:
123+ case ( . notifications, _ ) :
118124 return Constants . notificationsLogoAnimationLtr
119- case . reader:
125+ case ( . reader, _ ) :
120126 return Constants . readerLogoAnimationLtr
121- case . card:
127+ case ( _, . newUsers) :
128+ return Constants . wpJetpackLogoAnimationLtr
129+ case ( . card, _) :
122130 fallthrough
123- case . login:
131+ case ( . login, _ ) :
124132 fallthrough
125- case . appOpen:
133+ case ( . appOpen, _ ) :
126134 return Constants . allFeaturesLogosAnimationLtr
127135 }
128136 }
129137
130138 var animationRtl : String {
131- switch source {
132- case . stats:
139+ switch ( source, phase ) {
140+ case ( . stats, _ ) :
133141 return Constants . statsLogoAnimationRtl
134- case . notifications:
142+ case ( . notifications, _ ) :
135143 return Constants . notificationsLogoAnimationRtl
136- case . reader:
144+ case ( . reader, _ ) :
137145 return Constants . readerLogoAnimationRtl
138- case . card:
146+ case ( _, . newUsers) :
147+ return Constants . wpJetpackLogoAnimationRtl
148+ case ( . card, _) :
139149 fallthrough
140- case . login:
150+ case ( . login, _ ) :
141151 fallthrough
142- case . appOpen:
152+ case ( . appOpen, _ ) :
143153 return Constants . allFeaturesLogosAnimationRtl
144154 }
145155 }
@@ -185,6 +195,8 @@ struct JetpackFullscreenOverlayGeneralViewModel: JetpackFullscreenOverlayViewMod
185195 case . three:
186196 fallthrough
187197 case . four:
198+ fallthrough
199+ case . newUsers:
188200 return Strings . General. latePhasesSwitchButtonTitle
189201 default :
190202 return " "
@@ -199,12 +211,10 @@ struct JetpackFullscreenOverlayGeneralViewModel: JetpackFullscreenOverlayViewMod
199211 return Strings . General. notificationsContinueButtonTitle
200212 case ( . reader, _) :
201213 return Strings . General. readerContinueButtonTitle
202- case ( _, . three) :
203- return Strings . PhaseThree. generalContinueButtonTitle
204214 case ( _, . four) :
205215 return Strings . PhaseFour. generalContinueButtonTitle
206216 default :
207- return nil
217+ return Strings . General . continueButtonTitle
208218 }
209219 }
210220
@@ -226,6 +236,19 @@ struct JetpackFullscreenOverlayGeneralViewModel: JetpackFullscreenOverlayViewMod
226236 var onWillDismiss : JetpackOverlayDismissCallback ?
227237
228238 var onDidDismiss : JetpackOverlayDismissCallback ?
239+
240+ var secondaryView : UIView ? {
241+ switch phase {
242+ case . newUsers:
243+ return JetpackNewUsersOverlaySecondaryView ( )
244+ default :
245+ return nil
246+ }
247+ }
248+
249+ var isCompact : Bool {
250+ return phase == . newUsers
251+ }
229252}
230253
231254// MARK: Helpers
@@ -267,6 +290,8 @@ private extension JetpackFullscreenOverlayGeneralViewModel {
267290 static let notificationsLogoAnimationRtl = " JetpackNotificationsLogoAnimation_rtl "
268291 static let allFeaturesLogosAnimationLtr = " JetpackAllFeaturesLogosAnimation_ltr "
269292 static let allFeaturesLogosAnimationRtl = " JetpackAllFeaturesLogosAnimation_rtl "
293+ static let wpJetpackLogoAnimationLtr = " JetpackWordPressLogoAnimation_ltr "
294+ static let wpJetpackLogoAnimationRtl = " JetpackWordPressLogoAnimation_rtl "
270295 }
271296
272297 enum Strings {
@@ -287,6 +312,9 @@ private extension JetpackFullscreenOverlayGeneralViewModel {
287312 static let notificationsContinueButtonTitle = NSLocalizedString ( " jetpack.fullscreen.overlay.notifications.continue.title " ,
288313 value: " Continue to Notifications " ,
289314 comment: " Title of a button that dismisses an overlay and displays the Notifications screen. " )
315+ static let continueButtonTitle = NSLocalizedString ( " jetpack.fullscreen.overlay.phaseThree.general.continue.title " ,
316+ value: " Continue without Jetpack " ,
317+ comment: " Title of a button that dismisses an overlay that showcases the Jetpack app. " )
290318 }
291319
292320 enum PhaseOne {
@@ -344,10 +372,6 @@ private extension JetpackFullscreenOverlayGeneralViewModel {
344372 static let generalTitle = NSLocalizedString ( " jetpack.fullscreen.overlay.phaseThree.general.title " ,
345373 value: " Jetpack features are moving soon. " ,
346374 comment: " Title of a screen that showcases the Jetpack app. " )
347-
348- static let generalContinueButtonTitle = NSLocalizedString ( " jetpack.fullscreen.overlay.phaseThree.general.continue.title " ,
349- value: " Continue without Jetpack " ,
350- comment: " Title of a button that dismisses an overlay that showcases the Jetpack app. " )
351375 }
352376
353377 enum PhaseFour {
@@ -363,5 +387,15 @@ private extension JetpackFullscreenOverlayGeneralViewModel {
363387 value: " Do this later " ,
364388 comment: " Title of a button that dismisses an overlay that prompts the user to switch the Jetpack app. " )
365389 }
390+
391+ enum NewUsers {
392+ static let generalTitle = NSLocalizedString ( " jetpack.fullscreen.overlay.newUsers.title " ,
393+ value: " Give WordPress a boost with Jetpack " ,
394+ comment: " Title of a screen that prompts the user to switch the Jetpack app. " )
395+
396+ static let subtitle = NSLocalizedString ( " jetpack.fullscreen.overlay.newUsers.subtitle " ,
397+ value: " Jetpack lets you do more with your WordPress site. Switching is free and only takes a minute. " ,
398+ comment: " Title of a screen that prompts the user to switch the Jetpack app. " )
399+ }
366400 }
367401}
0 commit comments