mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add app specific privact and terms pages
This commit is contained in:
parent
ee59b8e857
commit
cf627e53cb
3 changed files with 30 additions and 11 deletions
|
|
@ -56,11 +56,15 @@ struct ProfileContainerView: View {
|
|||
}
|
||||
|
||||
Section {
|
||||
NavigationLink(destination: BasicWebAppView.privacyPolicyWebView) {
|
||||
NavigationLink(
|
||||
destination: BasicWebAppView.privacyPolicyWebView(baseURL: dataService.appEnvironment.webAppBaseURL)
|
||||
) {
|
||||
Text("Privacy Policy")
|
||||
}
|
||||
|
||||
NavigationLink(destination: BasicWebAppView.termsConditionsWebView) {
|
||||
NavigationLink(
|
||||
destination: BasicWebAppView.termsConditionsWebView(baseURL: dataService.appEnvironment.webAppBaseURL)
|
||||
) {
|
||||
Text("Terms and Conditions")
|
||||
}
|
||||
|
||||
|
|
@ -105,16 +109,21 @@ struct ProfileContainerView: View {
|
|||
}
|
||||
|
||||
private extension BasicWebAppView {
|
||||
static let privacyPolicyWebView: BasicWebAppView = {
|
||||
omnivoreWebView(path: "privacy")
|
||||
}()
|
||||
static func privacyPolicyWebView(baseURL: URL) -> BasicWebAppView {
|
||||
omnivoreWebView(path: "/app/privacy", baseURL: baseURL)
|
||||
}
|
||||
|
||||
static let termsConditionsWebView: BasicWebAppView = {
|
||||
omnivoreWebView(path: "terms")
|
||||
}()
|
||||
static func termsConditionsWebView(baseURL: URL) -> BasicWebAppView {
|
||||
omnivoreWebView(path: "/app/terms", baseURL: baseURL)
|
||||
}
|
||||
|
||||
private static func omnivoreWebView(path: String) -> BasicWebAppView {
|
||||
let urlString = "https://omnivore.app/\(path)?isAppEmbedView=true"
|
||||
return BasicWebAppView(request: URLRequest(url: URL(string: urlString)!))
|
||||
private static func omnivoreWebView(path: String, baseURL: URL) -> BasicWebAppView {
|
||||
let urlRequest = URLRequest.webRequest(
|
||||
baseURL: baseURL,
|
||||
urlPath: path,
|
||||
queryParams: nil
|
||||
)
|
||||
|
||||
return BasicWebAppView(request: urlRequest)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
5
packages/web/pages/app/privacy.tsx
Normal file
5
packages/web/pages/app/privacy.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { PrivacyPolicy } from '../../components/templates/PrivacyPolicy'
|
||||
|
||||
export default function Privacy(): JSX.Element {
|
||||
return <PrivacyPolicy />
|
||||
}
|
||||
5
packages/web/pages/app/terms.tsx
Normal file
5
packages/web/pages/app/terms.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { TermsAndConditions } from '../../components/templates/TermsAndConditions'
|
||||
|
||||
export default function Terms(): JSX.Element {
|
||||
return <TermsAndConditions />
|
||||
}
|
||||
Loading…
Reference in a new issue