diff --git a/ios/circolapp/circolapp/View/SettingsView.swift b/ios/circolapp/circolapp/View/SettingsView.swift index 4b6b955..27b3c7c 100644 --- a/ios/circolapp/circolapp/View/SettingsView.swift +++ b/ios/circolapp/circolapp/View/SettingsView.swift @@ -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")) { + Button(action: { + URLUtils.openUrl(url: "https://www.iubenda.com/privacy-policy/13230834") + }) { + Text("Privacy policy") + } HStack { Text("Version name") Spacer() diff --git a/shared/src/commonMain/kotlin/net/underdesk/circolapp/shared/server/ServerAPI.kt b/shared/src/commonMain/kotlin/net/underdesk/circolapp/shared/server/ServerAPI.kt index d6f0c0e..af89991 100644 --- a/shared/src/commonMain/kotlin/net/underdesk/circolapp/shared/server/ServerAPI.kt +++ b/shared/src/commonMain/kotlin/net/underdesk/circolapp/shared/server/ServerAPI.kt @@ -79,6 +79,11 @@ class ServerAPI(serverName: Servers) { 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) { Servers.CURIE -> CurieServer(ktorClient) Servers.PORPORATO -> PorporatoServer(ktorClient)