diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 0c67376eba..0000000000 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 08bb2194dd..158770485a 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -237,6 +237,9 @@ "room_timeline_beginning_of_room" = "This is the beginning of %1$@."; "room_timeline_beginning_of_room_no_name" = "This is the beginning of this conversation."; "room_timeline_read_marker_title" = "New"; +"screen_advanced_settings_element_call_base_url" = "Custom Element Call base URL"; +"screen_advanced_settings_element_call_base_url_description" = "Set a custom base URL for Element Call."; +"screen_advanced_settings_element_call_base_url_validation_error" = "Invalid URL, please make sure you include the protocol (http/https) and the correct address."; "screen_account_provider_change" = "Change account provider"; "screen_account_provider_form_hint" = "Homeserver address"; "screen_account_provider_form_notice" = "Enter a search term or a domain address."; @@ -280,7 +283,7 @@ "screen_change_server_title" = "Select your server"; "screen_chat_backup_key_backup_action_disable" = "Turn off backup"; "screen_chat_backup_key_backup_action_enable" = "Turn on backup"; -"screen_chat_backup_key_backup_description" = "Backup ensures that you don't lose your message history."; +"screen_chat_backup_key_backup_description" = "Backup ensures that you don't lose your message history. %1$@."; "screen_chat_backup_key_backup_title" = "Backup"; "screen_chat_backup_recovery_action_change" = "Change recovery key"; "screen_chat_backup_recovery_action_confirm" = "Confirm recovery key"; @@ -321,7 +324,7 @@ "screen_key_backup_disable_confirmation_action_turn_off" = "Turn off"; "screen_key_backup_disable_confirmation_description" = "You will lose your encrypted messages if you are signed out of all devices."; "screen_key_backup_disable_confirmation_title" = "Are you sure you want to turn off backup?"; -"screen_key_backup_disable_description" = "Turning off backup will remove your your current encryption key backup and turn off other security features. In this case, you will:"; +"screen_key_backup_disable_description" = "Turning off backup will remove your current encryption key backup and turn off other security features. In this case, you will:"; "screen_key_backup_disable_description_point_1" = "Not have encrypted message history on new devices"; "screen_key_backup_disable_description_point_2" = "Lose access to your encrypted messages if you are signed out of %1$@ everywhere"; "screen_key_backup_disable_title" = "Are you sure you want to turn off backup?"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index c75c842dc8..9f9631653d 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -598,6 +598,12 @@ public enum L10n { public static var screenAdvancedSettingsDeveloperMode: String { return L10n.tr("Localizable", "screen_advanced_settings_developer_mode") } /// Enable to have access to features and functionality for developers. public static var screenAdvancedSettingsDeveloperModeDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_developer_mode_description") } + /// Custom Element Call base URL + public static var screenAdvancedSettingsElementCallBaseUrl: String { return L10n.tr("Localizable", "screen_advanced_settings_element_call_base_url") } + /// Set a custom base URL for Element Call. + public static var screenAdvancedSettingsElementCallBaseUrlDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_element_call_base_url_description") } + /// Invalid URL, please make sure you include the protocol (http/https) and the correct address. + public static var screenAdvancedSettingsElementCallBaseUrlValidationError: String { return L10n.tr("Localizable", "screen_advanced_settings_element_call_base_url_validation_error") } /// Disable the rich text editor to type Markdown manually. public static var screenAdvancedSettingsRichTextEditorDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_rich_text_editor_description") } /// We won't record or profile any personal data @@ -680,8 +686,10 @@ public enum L10n { public static var screenChatBackupKeyBackupActionDisable: String { return L10n.tr("Localizable", "screen_chat_backup_key_backup_action_disable") } /// Turn on backup public static var screenChatBackupKeyBackupActionEnable: String { return L10n.tr("Localizable", "screen_chat_backup_key_backup_action_enable") } - /// Backup ensures that you don't lose your message history. - public static var screenChatBackupKeyBackupDescription: String { return L10n.tr("Localizable", "screen_chat_backup_key_backup_description") } + /// Backup ensures that you don't lose your message history. %1$@. + public static func screenChatBackupKeyBackupDescription(_ p1: Any) -> String { + return L10n.tr("Localizable", "screen_chat_backup_key_backup_description", String(describing: p1)) + } /// Backup public static var screenChatBackupKeyBackupTitle: String { return L10n.tr("Localizable", "screen_chat_backup_key_backup_title") } /// Change recovery key @@ -786,7 +794,7 @@ public enum L10n { public static var screenKeyBackupDisableConfirmationDescription: String { return L10n.tr("Localizable", "screen_key_backup_disable_confirmation_description") } /// Are you sure you want to turn off backup? public static var screenKeyBackupDisableConfirmationTitle: String { return L10n.tr("Localizable", "screen_key_backup_disable_confirmation_title") } - /// Turning off backup will remove your your current encryption key backup and turn off other security features. In this case, you will: + /// Turning off backup will remove your current encryption key backup and turn off other security features. In this case, you will: public static var screenKeyBackupDisableDescription: String { return L10n.tr("Localizable", "screen_key_backup_disable_description") } /// Not have encrypted message history on new devices public static var screenKeyBackupDisableDescriptionPoint1: String { return L10n.tr("Localizable", "screen_key_backup_disable_description_point_1") } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenUserMenuButton.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenUserMenuButton.swift index 1cfd6211e8..0f0c083a18 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenUserMenuButton.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenUserMenuButton.swift @@ -80,7 +80,6 @@ struct HomeScreenUserMenuButton: View { /// Menu doesn't render composed views. Trick it into showing a badge. private var settingsIconImage: Image? { let settingsIcon = Image(systemSymbol: .gearshape) - .symbolRenderingMode(.palette) .resizable() .frame(width: 100, height: 100) .overlayBadge(40, isBadged: context.viewState.showSettingsMenuOptionBadge) diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenModels.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenModels.swift index 5b6ecb988d..4506e0aef9 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenModels.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenModels.swift @@ -22,6 +22,7 @@ enum SecureBackupScreenViewModelAction { } struct SecureBackupScreenViewState: BindableState { + let chatBackupDetailsURL: URL var recoveryKeyState = SecureBackupRecoveryKeyState.unknown var keyBackupState = SecureBackupKeyBackupState.unknown var bindings = SecureBackupScreenViewStateBindings() @@ -34,5 +35,4 @@ struct SecureBackupScreenViewStateBindings { enum SecureBackupScreenViewAction { case recoveryKey case keyBackup - case learnMore } diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModel.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModel.swift index 8dabba8782..aacba17325 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModel.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModel.swift @@ -22,7 +22,6 @@ typealias SecureBackupScreenViewModelType = StateStoreViewModel = .init() var actions: AnyPublisher { @@ -34,9 +33,8 @@ class SecureBackupScreenViewModel: SecureBackupScreenViewModelType, SecureBackup chatBackupDetailsURL: URL) { self.secureBackupController = secureBackupController self.userIndicatorController = userIndicatorController - self.chatBackupDetailsURL = chatBackupDetailsURL - super.init(initialViewState: .init()) + super.init(initialViewState: .init(chatBackupDetailsURL: chatBackupDetailsURL)) secureBackupController.recoveryKeyState .receive(on: DispatchQueue.main) @@ -64,8 +62,6 @@ class SecureBackupScreenViewModel: SecureBackupScreenViewModelType, SecureBackup default: break } - case .learnMore: - UIApplication.shared.open(chatBackupDetailsURL) } } diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift index 13db5f6568..6733768e6f 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift @@ -47,13 +47,9 @@ struct SecureBackupScreen: View { .font(.compound.bodyLGSemibold) .foregroundColor(.compound.textPrimary) - Button { - context.send(viewAction: .learnMore) - } label: { - Text((try? AttributedString(markdown: "\(L10n.screenChatBackupKeyBackupDescription) **\(L10n.actionLearnMore)**")) ?? "") - .font(.compound.bodySM) - .foregroundColor(.compound.textSecondary) - } + Text(keyBackupDescriptionWithLearnMoreLink) + .font(.compound.bodySM) + .foregroundColor(.compound.textSecondary) } .padding(.horizontal, ListRowPadding.horizontal) .padding(.vertical, ListRowPadding.vertical) @@ -64,6 +60,16 @@ struct SecureBackupScreen: View { } } + private var keyBackupDescriptionWithLearnMoreLink: AttributedString { + let linkPlaceholder = "{link}" + var description = AttributedString(L10n.screenChatBackupKeyBackupDescription(linkPlaceholder)) + var linkString = AttributedString(L10n.actionLearnMore) + linkString.link = context.viewState.chatBackupDetailsURL + linkString.bold() + description.replace(linkPlaceholder, with: linkString) + return description + } + @ViewBuilder private var keyBackupButton: some View { switch context.viewState.keyBackupState { @@ -76,7 +82,7 @@ struct SecureBackupScreen: View { context.send(viewAction: .keyBackup) }) default: - ListRow(label: .plain(title: L10n.commonLoading), details: .isWaiting(true), kind: .button { }) + ListRow(label: .plain(title: L10n.commonLoading), details: .isWaiting(true), kind: .label) } } @@ -95,7 +101,7 @@ struct SecureBackupScreen: View { ListRow(label: .plain(title: L10n.screenChatBackupRecoveryActionConfirm), kind: .navigationLink { context.send(viewAction: .recoveryKey) }) default: - ListRow(label: .plain(title: L10n.commonLoading), details: .isWaiting(true), kind: .button { }) + ListRow(label: .plain(title: L10n.commonLoading), details: .isWaiting(true), kind: .label) } } footer: { recoveryKeySectionFooter