imp: legal modal

This commit is contained in:
ryanzhao 2023-08-23 17:28:36 +10:00
parent a9dcfaa3b9
commit c7c5969e6f
23 changed files with 69 additions and 1 deletions

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -684,3 +684,5 @@
"recovery_password_error_length" = "The Recovery Password you entered is not long enough. Please check and try again.";
"recovery_password_error_invalid" = "Some of the words in your Recovery Password are incorrect. Please check and try again.";
"recovery_password_error_generic" = "Please check your Recovery Password and try again.";
"modal_open_url_title_2" = "Open URL";
"modal_open_url_explanation_2" = "This will open in your browser.";

View File

@ -80,7 +80,7 @@ struct LandingView: View {
.padding(.horizontal, Values.massiveSpacing)
Button {
openLegalUrl()
} label: {
let attributedText: NSAttributedString = {
let text = String(format: "onboarding_T&C".localized(), "terms_of_service".localized(), "privacy_policy".localized())
@ -124,6 +124,30 @@ struct LandingView: View {
viewController.setNavBarTitle("onboarding_load_account_title".localized())
self.host.controller?.navigationController?.pushViewController(viewController, animated: true)
}
private func openLegalUrl() {
let modal: ConfirmationModal = ConfirmationModal(
info: ConfirmationModal.Info(
title: "modal_open_url_title_2".localized(),
body: .text("modal_open_url_explanation_2".localized()),
confirmTitle: "terms_of_service".localized(),
confirmStyle: .textPrimary,
cancelTitle: "privacy_policy".localized(),
cancelStyle: .textPrimary,
onConfirm: { _ in
if let url: URL = URL(string: "https://getsession.org/terms-of-service") {
UIApplication.shared.open(url)
}
},
onCancel: { _ in
if let url: URL = URL(string: "https://getsession.org/privacy-policy") {
UIApplication.shared.open(url)
}
}
)
)
self.host.controller?.present(modal, animated: true)
}
}
struct ChatBubble: View {