Add RoomDetails for use (with RoomMemberDetails) in AvatarHeaderView. (#2490)

* Add RoomDetails and refactor AvatarHeaderView to use it.
* Remove old displayName property and use RoomDetails in the RoomDetailsScreenViewState
This commit is contained in:
Doug
2024-02-21 14:19:05 +00:00
committed by GitHub
parent 9b949ce84e
commit 730d099a76
48 changed files with 255 additions and 191 deletions
@@ -436,12 +436,12 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
}
if room.isPublic {
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .public)
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomID: roomId, isDM: room.isEncryptedOneToOneRoom, state: .public)
} else {
state.bindings.leaveRoomAlertItem = if room.joinedMembersCount > 1 {
LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .private)
LeaveRoomAlertItem(roomID: roomId, isDM: room.isEncryptedOneToOneRoom, state: .private)
} else {
LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .empty)
LeaveRoomAlertItem(roomID: roomId, isDM: room.isEncryptedOneToOneRoom, state: .empty)
}
}
}
@@ -184,7 +184,7 @@ struct HomeScreen: View {
private func leaveRoomAlertActions(_ item: LeaveRoomAlertItem) -> some View {
Button(item.cancelTitle, role: .cancel) { }
Button(item.confirmationTitle, role: .destructive) {
context.send(viewAction: .confirmLeaveRoom(roomIdentifier: item.roomId))
context.send(viewAction: .confirmLeaveRoom(roomIdentifier: item.roomID))
}
}