mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Extend the room details screen hook (#6173)
* Allow Enterprise sections in room details Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com> * Update the Enterprise submodule and strings Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com> --------- Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
This commit is contained in:
@@ -1322,6 +1322,9 @@
|
|||||||
"screen_room_details_profile_row_title" = "Profile";
|
"screen_room_details_profile_row_title" = "Profile";
|
||||||
"screen_room_details_requests_to_join_title" = "Requests to join";
|
"screen_room_details_requests_to_join_title" = "Requests to join";
|
||||||
"screen_room_details_roles_and_permissions" = "Roles & permissions";
|
"screen_room_details_roles_and_permissions" = "Roles & permissions";
|
||||||
|
"screen_room_details_room_audio_ptt" = "Push to talk";
|
||||||
|
"screen_room_details_room_audio_title" = "Room Audio";
|
||||||
|
"screen_room_details_room_audio_video_calls" = "Video calls";
|
||||||
"screen_room_details_room_name_label" = "Name";
|
"screen_room_details_room_name_label" = "Name";
|
||||||
"screen_room_details_security_and_privacy_title" = "Security & privacy";
|
"screen_room_details_security_and_privacy_title" = "Security & privacy";
|
||||||
"screen_room_details_security_title" = "Security";
|
"screen_room_details_security_title" = "Security";
|
||||||
|
|||||||
@@ -1322,6 +1322,9 @@
|
|||||||
"screen_room_details_profile_row_title" = "Profile";
|
"screen_room_details_profile_row_title" = "Profile";
|
||||||
"screen_room_details_requests_to_join_title" = "Requests to join";
|
"screen_room_details_requests_to_join_title" = "Requests to join";
|
||||||
"screen_room_details_roles_and_permissions" = "Roles & permissions";
|
"screen_room_details_roles_and_permissions" = "Roles & permissions";
|
||||||
|
"screen_room_details_room_audio_ptt" = "Push to talk";
|
||||||
|
"screen_room_details_room_audio_title" = "Room Audio";
|
||||||
|
"screen_room_details_room_audio_video_calls" = "Video calls";
|
||||||
"screen_room_details_room_name_label" = "Name";
|
"screen_room_details_room_name_label" = "Name";
|
||||||
"screen_room_details_security_and_privacy_title" = "Security & privacy";
|
"screen_room_details_security_and_privacy_title" = "Security & privacy";
|
||||||
"screen_room_details_security_title" = "Security";
|
"screen_room_details_security_title" = "Security";
|
||||||
|
|||||||
@@ -5,14 +5,19 @@
|
|||||||
// Please see LICENSE files in the repository root for full details.
|
// Please see LICENSE files in the repository root for full details.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import SwiftUI
|
||||||
|
|
||||||
nonisolated protocol RoomDetailsScreenHookProtocol: Sendable {
|
nonisolated protocol RoomDetailsScreenHookProtocol: Sendable {
|
||||||
@MainActor func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState
|
@MainActor func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState
|
||||||
|
@MainActor func additionalSections() -> AnyView?
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DefaultRoomDetailsScreenHook: RoomDetailsScreenHookProtocol {
|
struct DefaultRoomDetailsScreenHook: RoomDetailsScreenHookProtocol {
|
||||||
func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState {
|
func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState {
|
||||||
viewState
|
viewState
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func additionalSections() -> AnyView? {
|
||||||
|
nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3062,6 +3062,12 @@ internal nonisolated enum L10n {
|
|||||||
internal static var screenRoomDetailsRequestsToJoinTitle: String { return L10n.tr("Localizable", "screen_room_details_requests_to_join_title") }
|
internal static var screenRoomDetailsRequestsToJoinTitle: String { return L10n.tr("Localizable", "screen_room_details_requests_to_join_title") }
|
||||||
/// Roles & permissions
|
/// Roles & permissions
|
||||||
internal static var screenRoomDetailsRolesAndPermissions: String { return L10n.tr("Localizable", "screen_room_details_roles_and_permissions") }
|
internal static var screenRoomDetailsRolesAndPermissions: String { return L10n.tr("Localizable", "screen_room_details_roles_and_permissions") }
|
||||||
|
/// Push to talk
|
||||||
|
internal static var screenRoomDetailsRoomAudioPtt: String { return L10n.tr("Localizable", "screen_room_details_room_audio_ptt") }
|
||||||
|
/// Room Audio
|
||||||
|
internal static var screenRoomDetailsRoomAudioTitle: String { return L10n.tr("Localizable", "screen_room_details_room_audio_title") }
|
||||||
|
/// Video calls
|
||||||
|
internal static var screenRoomDetailsRoomAudioVideoCalls: String { return L10n.tr("Localizable", "screen_room_details_room_audio_video_calls") }
|
||||||
/// Name
|
/// Name
|
||||||
internal static var screenRoomDetailsRoomNameLabel: String { return L10n.tr("Localizable", "screen_room_details_room_name_label") }
|
internal static var screenRoomDetailsRoomNameLabel: String { return L10n.tr("Localizable", "screen_room_details_room_name_label") }
|
||||||
/// Security & privacy
|
/// Security & privacy
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ struct DMRecipientInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct RoomDetailsScreenViewState: BindableState {
|
struct RoomDetailsScreenViewState: BindableState {
|
||||||
|
let appHooks: AppHooks
|
||||||
var details: RoomDetails
|
var details: RoomDetails
|
||||||
|
|
||||||
var isEncrypted: Bool
|
var isEncrypted: Bool
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
|||||||
|
|
||||||
let topic = attributedStringBuilder.fromPlain(roomProxy.infoPublisher.value.topic)
|
let topic = attributedStringBuilder.fromPlain(roomProxy.infoPublisher.value.topic)
|
||||||
|
|
||||||
let viewState = RoomDetailsScreenViewState(details: roomProxy.details,
|
let viewState = RoomDetailsScreenViewState(appHooks: appHooks,
|
||||||
|
details: roomProxy.details,
|
||||||
isEncrypted: roomProxy.infoPublisher.value.isEncrypted,
|
isEncrypted: roomProxy.infoPublisher.value.isEncrypted,
|
||||||
isDirect: roomProxy.infoPublisher.value.isDirect,
|
isDirect: roomProxy.infoPublisher.value.isDirect,
|
||||||
topic: topic,
|
topic: topic,
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ struct RoomDetailsScreen: View {
|
|||||||
|
|
||||||
topicSection
|
topicSection
|
||||||
|
|
||||||
|
context.viewState.appHooks
|
||||||
|
.roomDetailsScreenHook
|
||||||
|
.additionalSections()
|
||||||
|
|
||||||
aboutSection
|
aboutSection
|
||||||
|
|
||||||
// The invitation flow is different for DMs
|
// The invitation flow is different for DMs
|
||||||
|
|||||||
+1
-1
Submodule Enterprise updated: ceb068874e...44949031c7
Reference in New Issue
Block a user