Skip to content

Commit 5b36260

Browse files
committed
Add helper method to show alert for instruction to connect to a WP.com site
1 parent 78e298a commit 5b36260

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

WooCommerce/Classes/ViewRelated/Fancy Alerts/FancyAlertViewController+UnifiedLogin.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ extension FancyAlertViewController {
3737
return controller
3838

3939
}
40+
41+
static func makeConnectAccountToWPComSiteAlert() -> FancyAlertViewController {
42+
let dismissButton = makeDismissButtonConfig()
43+
let config = FancyAlertViewController.Config(titleText: Localization.connectToWPComSite,
44+
bodyText: Localization.connectToWPComSiteDescription,
45+
headerImage: nil,
46+
dividerPosition: .top,
47+
defaultButton: dismissButton,
48+
cancelButton: nil,
49+
dismissAction: {})
50+
51+
let controller = FancyAlertViewController.controllerWithConfiguration(configuration: config)
52+
return controller
53+
}
4054
}
4155

4256

@@ -79,6 +93,18 @@ private extension FancyAlertViewController {
7993
"Need more help?",
8094
comment: "Title of button to learn more presented when users attempt to log in with an email address that does not match a WP.com account"
8195
)
96+
97+
static let connectToWPComSite = NSLocalizedString(
98+
"Connecting to a WordPress.com site",
99+
comment: "Title of alert for suggestion on how to connect to a WP.com site" +
100+
"Presented when a user logs in with an email that does not have access to a WP.com site"
101+
)
102+
103+
static let connectToWPComSiteDescription = NSLocalizedString(
104+
"Please contact the site owner for an invitation to the site as a shop manager or administrator to use the app.",
105+
comment: "Description of alert for suggestion on how to connect to a WP.com site" +
106+
"Presented when a user logs in with an email that does not have access to a WP.com site"
107+
)
82108
}
83109

84110
enum Strings {

0 commit comments

Comments
 (0)