-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (LekaApp): Add ConsentView in SignUp flow w/ policy content
- Loading branch information
Showing
4 changed files
with
151 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import SwiftUI | ||
|
||
struct ConsentView: View { | ||
// MARK: Internal | ||
|
||
let onCancel: () -> Void | ||
let onAccept: () -> Void | ||
|
||
var body: some View { | ||
NavigationStack { | ||
VStack(spacing: 0) { | ||
ScrollView { | ||
PrivacyPolicyView() | ||
.padding(.bottom) | ||
} | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
|
||
VStack(spacing: 14) { | ||
Divider() | ||
Group { | ||
Toggle(isOn: self.$isConsentGiven) { | ||
Label("I have read and agree to the terms and privacy policy.", systemImage: "checkmark.shield.fill") | ||
} | ||
|
||
Button("Continue", action: self.onAccept) | ||
.buttonStyle(.borderedProminent) | ||
.disabled(!self.isConsentGiven) | ||
} | ||
.padding([.bottom, .horizontal]) | ||
} | ||
.background(Color(.systemGray6)) | ||
.edgesIgnoringSafeArea(.bottom) | ||
} | ||
.navigationTitle("Privacy Policy") | ||
.navigationBarTitleDisplayMode(.inline) | ||
.toolbar { | ||
ToolbarItem(placement: .navigationBarLeading) { | ||
Button("Cancel", action: self.onCancel) | ||
} | ||
} | ||
} | ||
} | ||
|
||
// MARK: Private | ||
|
||
@State private var isConsentGiven: Bool = false | ||
} | ||
|
||
// MARK: - ConsentView_Previews | ||
|
||
#Preview { | ||
ConsentView( | ||
onCancel: { | ||
print("Content was declined") | ||
}, | ||
onAccept: { | ||
print("Consent was given") | ||
} | ||
) | ||
} |
70 changes: 70 additions & 0 deletions
70
Apps/LekaApp/Sources/Views/ConsentView/PrivacyPolicyView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import MarkdownUI | ||
import SwiftUI | ||
|
||
struct PrivacyPolicyView: View { | ||
// MARK: Internal | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 16) { | ||
Markdown(self.markdownText) | ||
.markdownTheme(.gitHub) | ||
.padding() | ||
.multilineTextAlignment(.leading) | ||
} | ||
} | ||
|
||
// MARK: Private | ||
|
||
// swiftlint:disable line_length | ||
private let markdownText = """ | ||
# Who we are | ||
The address of our site: [https://leka.io](https://leka.io) | ||
## Comments | ||
When you leave a comment on our site, the data entered in the comment form as well as your IP address and your browser's user-agent are collected to help us detect undesirable comments. | ||
An anonymized string created from your email address (also called a hash) may be sent to the Gravatar service to verify your use of the service. The Gravatar service privacy policy is available [here](https://automattic.com/privacy/). After validation of your comment, your profile picture will be publicly visible beside your comment. | ||
## Media | ||
If you upload images to the site, we advise you to avoid uploading images that contain EXIF data of GPS coordinates. People visiting your site may download and extract location data from these images. | ||
## Cookies | ||
If you leave a comment on our site, you will be asked to save your name, email address, and site in cookies. This is only for your convenience so that you do not have to enter this information if you leave another comment later. These cookies expire after one year. | ||
If you go to the login page, a temporary cookie will be created to determine if your browser accepts cookies. It does not contain any personal information and will be deleted automatically when you close your browser. | ||
When you log in, we will set a number of cookies to store your login information and screen preferences. The lifetime of a login cookie is two days, and the lifetime of a screen option cookie is one year. If you tick “Remember me”, your login cookie will be kept for two weeks. If you log out of your account, the login cookie will be deleted. | ||
By editing or publishing a post, an additional cookie will be stored in your browser. This cookie does not include any personal information. It simply indicates the ID of the publication you have just modified. It expires after one day. | ||
## Embedded content from other sites | ||
Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other sites behaves in the same way as if the visitor were on that other site. | ||
These websites may collect data about you, use cookies, embed third-party tracking tools, and track your interactions with such embedded content if you have an account with their website. | ||
## Use and disclosure of your personal data | ||
If you request a password reset, your IP address will be included in the reset email. | ||
## How long we store your data | ||
If you leave a comment, the comment and its metadata are kept indefinitely. This allows us to automatically recognize and approve subsequent comments instead of leaving them in the moderation queue. | ||
For accounts that register with our site (if any), we also store the personal data listed in their profile. All accounts can view, edit, or delete their personal information at any time (except for their user ID). Site managers can also view and edit this information. | ||
## The rights you have over your data | ||
If you have an account or if you have left comments on the site, you can request to receive a file containing all the personal data that we have about you, including those that you have provided to us. You may also request the deletion of your personal data. This does not include data stored for administrative, legal, or security purposes. | ||
## Disclosure of your personal data | ||
Visitors' comments can be checked using an automated service to detect undesirable comments. | ||
""" | ||
// swiftlint:enable line_length | ||
} | ||
|
||
// MARK: - PrivacyPolicyView_Previews | ||
|
||
#Preview { | ||
PrivacyPolicyView() | ||
} |
21 changes: 0 additions & 21 deletions
21
Modules/AccountKit/Sources/Extensions/ConsentInfo+Codable.swift
This file was deleted.
Oops, something went wrong.