Skip to content

Commit 4939467

Browse files
committed
Open the Terms of Service URL in a Safari sheet instead of opening the URL in the browser out of the app.
1 parent ddba4a8 commit 4939467

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

WooCommerce/Classes/ViewRelated/Authentication/AccountCreationForm.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct AccountCreationForm: View {
4949
@ObservedObject private var viewModel: AccountCreationFormViewModel
5050

5151
@State private var isPerformingTask = false
52+
@State private var tosURL: URL?
5253

5354
@FocusState private var focusedField: Field?
5455

@@ -112,6 +113,10 @@ struct AccountCreationForm: View {
112113
// Terms of Service link.
113114
AttributedText(tosAttributedText)
114115
.attributedTextLinkColor(Color(.textLink))
116+
.environment(\.customOpenURL) { url in
117+
tosURL = url
118+
}
119+
.safariSheet(url: $tosURL)
115120
}
116121

117122
// CTA to submit the form.

0 commit comments

Comments
 (0)