mirror of
https://github.com/Matte23/circolapp.git
synced 2025-12-06 07:29:10 +00:00
Add link to privacy policy and school website in settings
This commit is contained in:
@@ -36,7 +36,22 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Section(header: Text("SCHOOL")) {
|
||||||
|
Button(action: {
|
||||||
|
let schoolID = UserDefaults.standard.integer(forKey: "school")
|
||||||
|
let server = serverCompanion.getServer(serverID: Int32(schoolID))
|
||||||
|
URLUtils.openUrl(url: serverCompanion.getServerWebsite(server: server))
|
||||||
|
}) {
|
||||||
|
Text("School website")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Section(header: Text("ABOUT")) {
|
Section(header: Text("ABOUT")) {
|
||||||
|
Button(action: {
|
||||||
|
URLUtils.openUrl(url: "https://www.iubenda.com/privacy-policy/13230834")
|
||||||
|
}) {
|
||||||
|
Text("Privacy policy")
|
||||||
|
}
|
||||||
HStack {
|
HStack {
|
||||||
Text("Version name")
|
Text("Version name")
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ class ServerAPI(serverName: Servers) {
|
|||||||
Servers.PORPORATO -> "Liceo G.F. Porporato"
|
Servers.PORPORATO -> "Liceo G.F. Porporato"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getServerWebsite(server: Servers) = when (server) {
|
||||||
|
Servers.CURIE -> "https://www.curiepinerolo.edu.it/"
|
||||||
|
Servers.PORPORATO -> "https://www.liceoporporato.edu.it/"
|
||||||
|
}
|
||||||
|
|
||||||
fun createServer(server: Servers, ktorClient: HttpClient) = when (server) {
|
fun createServer(server: Servers, ktorClient: HttpClient) = when (server) {
|
||||||
Servers.CURIE -> CurieServer(ktorClient)
|
Servers.CURIE -> CurieServer(ktorClient)
|
||||||
Servers.PORPORATO -> PorporatoServer(ktorClient)
|
Servers.PORPORATO -> PorporatoServer(ktorClient)
|
||||||
|
|||||||
Reference in New Issue
Block a user