mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Design Tweaks (#3606)
* updated the order of the room details also... - removed the bloom bg from the join room screen - now DMs do not necessarily need to be encrypted rooms - changed bg of the knock banner * removed unnecessary disabled * updated join room screen tests
This commit is contained in:
@@ -129,11 +129,11 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
actionsSubject.send(.requestInvitePeoplePresentation)
|
||||
case .processTapLeave:
|
||||
guard state.joinedMembersCount > 1 else {
|
||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomID: roomProxy.id, isDM: roomProxy.isEncryptedOneToOneRoom, state: .empty)
|
||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomID: roomProxy.id, isDM: roomProxy.isDirectOneToOneRoom, state: .empty)
|
||||
return
|
||||
}
|
||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomID: roomProxy.id,
|
||||
isDM: roomProxy.isEncryptedOneToOneRoom,
|
||||
isDM: roomProxy.isDirectOneToOneRoom,
|
||||
state: roomProxy.infoPublisher.value.isPublic ? .public : .private)
|
||||
case .confirmLeave:
|
||||
Task { await leaveRoom() }
|
||||
@@ -205,7 +205,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
|
||||
private func fetchMembersIfNeeded() async {
|
||||
// We need to fetch members just in 1-to-1 chat to get the member object for the other person
|
||||
guard roomProxy.isEncryptedOneToOneRoom else {
|
||||
guard roomProxy.isDirectOneToOneRoom else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@ struct RoomDetailsScreen: View {
|
||||
topicSection
|
||||
|
||||
configurationSection
|
||||
|
||||
if context.viewState.dmRecipient == nil {
|
||||
peopleSection
|
||||
}
|
||||
|
||||
aboutSection
|
||||
|
||||
@@ -151,16 +155,6 @@ struct RoomDetailsScreen: View {
|
||||
|
||||
private var aboutSection: some View {
|
||||
Section {
|
||||
if context.viewState.dmRecipient == nil {
|
||||
ListRow(label: .default(title: L10n.commonPeople,
|
||||
icon: \.user),
|
||||
details: .title(String(context.viewState.joinedMembersCount)),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .processTapPeople)
|
||||
})
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomDetailsScreen.people)
|
||||
}
|
||||
|
||||
ListRow(label: .default(title: L10n.screenRoomDetailsPinnedEventsRowTitle,
|
||||
icon: \.pin),
|
||||
details: context.viewState.pinnedEventsActionState.isLoading ? .isWaiting(true) : .title(context.viewState.pinnedEventsActionState.count),
|
||||
@@ -213,7 +207,18 @@ struct RoomDetailsScreen: View {
|
||||
.onChange(of: context.isFavourite) { _, newValue in
|
||||
context.send(viewAction: .toggleFavourite(isFavourite: newValue))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private var peopleSection: some View {
|
||||
Section {
|
||||
ListRow(label: .default(title: L10n.commonPeople,
|
||||
icon: \.user),
|
||||
details: .title(String(context.viewState.joinedMembersCount)),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .processTapPeople)
|
||||
})
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomDetailsScreen.people)
|
||||
if context.viewState.canEditRolesOrPermissions, context.viewState.dmRecipient == nil {
|
||||
ListRow(label: .default(title: L10n.screenRoomDetailsRolesAndPermissions,
|
||||
icon: \.admin),
|
||||
@@ -222,7 +227,6 @@ struct RoomDetailsScreen: View {
|
||||
})
|
||||
}
|
||||
}
|
||||
.disabled(context.viewState.notificationSettingsState.isLoading)
|
||||
}
|
||||
|
||||
private var toggleMuteButton: some View {
|
||||
|
||||
Reference in New Issue
Block a user