Add a link to the global settings in the room notifications settings (#1433)

This commit is contained in:
Nicolas Mauri
2023-08-02 18:30:05 +02:00
committed by GitHub
parent 6e5854abf9
commit 17aa0c632f
13 changed files with 153 additions and 21 deletions
@@ -16,7 +16,9 @@
import Foundation
enum RoomNotificationSettingsScreenViewModelAction { }
enum RoomNotificationSettingsScreenViewModelAction {
case openGlobalSettings
}
enum RoomNotificationSettingsState {
case loading
@@ -66,15 +68,20 @@ struct RoomNotificationSettingsScreenViewStateBindings {
enum RoomNotificationSettingsScreenViewAction {
case changedAllowCustomSettings
case setCustomMode(RoomNotificationModeProxy)
case customSettingFootnoteLinkTapped
}
struct RoomNotificationSettingsScreenStrings {
let customSettingFootnote: AttributedString
let customSettingFootnoteLink: URL?
init() {
customSettingFootnoteLink = URL(string: "element://openGlobalSettings")
let linkPlaceholder = "{link}"
var customSettingFootnote = AttributedString(L10n.screenRoomNotificationSettingsDefaultSettingFootnote(linkPlaceholder))
var linkString = AttributedString(L10n.screenRoomNotificationSettingsDefaultSettingFootnoteContentLink)
linkString.link = customSettingFootnoteLink
linkString.bold()
customSettingFootnote.replace(linkPlaceholder, with: linkString)