Skip to content

Commit

Permalink
dm design tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed Jan 21, 2025
1 parent 55e399a commit 5ff8f46
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"a11y_user_menu" = "User menu";
"a11y_voice_message_record" = "Record voice message.";
"a11y_voice_message_stop_recording" = "Stop recording";
"a11y.view_details" = "View details";
"action_accept" = "Accept";
"action_add_caption" = "Add caption";
"action_add_to_timeline" = "Add to timeline";
Expand Down Expand Up @@ -440,6 +441,7 @@
"screen_room_single_knock_request_title" = "%1$@ wants to join this room";
"screen_room_single_knock_request_view_button_title" = "View";
"screen_room_details_pinned_events_row_title" = "Pinned messages";
"screen_room_details_profile_row_title" = "Profile";
"screen_room_details_requests_to_join_title" = "Requests to join";
"screen_room_details_security_and_privacy_title" = "Security & privacy";
"screen_roomlist_knock_event_sent_description" = "Request to join sent";
Expand Down
2 changes: 2 additions & 0 deletions ElementX/Resources/Localizations/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"a11y_user_menu" = "User menu";
"a11y_voice_message_record" = "Record voice message.";
"a11y_voice_message_stop_recording" = "Stop recording";
"a11y.view_details" = "View details";
"action_accept" = "Accept";
"action_add_caption" = "Add caption";
"action_add_to_timeline" = "Add to timeline";
Expand Down Expand Up @@ -440,6 +441,7 @@
"screen_room_single_knock_request_title" = "%1$@ wants to join this room";
"screen_room_single_knock_request_view_button_title" = "View";
"screen_room_details_pinned_events_row_title" = "Pinned messages";
"screen_room_details_profile_row_title" = "Profile";
"screen_room_details_requests_to_join_title" = "Requests to join";
"screen_room_details_security_and_privacy_title" = "Security & privacy";
"screen_roomlist_knock_event_sent_description" = "Request to join sent";
Expand Down
2 changes: 2 additions & 0 deletions ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
stateMachine.tryEvent(.presentMediaEventsTimeline)
case .presentSecurityAndPrivacyScreen:
stateMachine.tryEvent(.presentSecurityAndPrivacyScreen)
case .presentRecipientDetails(let userID):
stateMachine.tryEvent(.presentRoomMemberDetails(userID: userID))
}
}
.store(in: &cancellables)
Expand Down
7 changes: 7 additions & 0 deletions ElementX/Sources/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,8 @@ internal enum L10n {
internal static var screenRoomDetailsNotificationTitle: String { return L10n.tr("Localizable", "screen_room_details_notification_title") }
/// Pinned messages
internal static var screenRoomDetailsPinnedEventsRowTitle: String { return L10n.tr("Localizable", "screen_room_details_pinned_events_row_title") }
/// Profile
internal static var screenRoomDetailsProfileRowTitle: String { return L10n.tr("Localizable", "screen_room_details_profile_row_title") }
/// Requests to join
internal static var screenRoomDetailsRequestsToJoinTitle: String { return L10n.tr("Localizable", "screen_room_details_requests_to_join_title") }
/// Roles and permissions
Expand Down Expand Up @@ -2781,6 +2783,11 @@ internal enum L10n {
/// Check UnifiedPush
internal static var troubleshootNotificationsTestUnifiedPushTitle: String { return L10n.tr("Localizable", "troubleshoot_notifications_test_unified_push_title") }

internal enum A11y {
/// View details
internal static var viewDetails: String { return L10n.tr("Localizable", "a11y.view_details") }
}

internal enum Common {
/// Copied to clipboard
internal static var copiedToClipboard: String { return L10n.tr("Localizable", "common.copied_to_clipboard") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct RoomDetailsScreenCoordinatorParameters {
enum RoomDetailsScreenCoordinatorAction {
case leftRoom
case presentRoomMembersList
case presentRecipientDetails(userID: String)
case presentRoomDetailsEditScreen
case presentNotificationSettingsScreen
case presentInviteUsersScreen
Expand Down Expand Up @@ -88,6 +89,8 @@ final class RoomDetailsScreenCoordinator: CoordinatorProtocol {
actionsSubject.send(.presentKnockingRequestsListScreen)
case .displaySecurityAndPrivacy:
actionsSubject.send(.presentSecurityAndPrivacyScreen)
case .requestRecipientDetailsPresentation(let userID):
actionsSubject.send(.presentRecipientDetails(userID: userID))
}
}
.store(in: &cancellables)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import SwiftUI
enum RoomDetailsScreenViewModelAction {
case requestNotificationSettingsPresentation
case requestMemberDetailsPresentation
case requestRecipientDetailsPresentation(userID: String)
case requestInvitePeoplePresentation
case leftRoom
case requestEditDetailsPresentation
Expand Down Expand Up @@ -198,6 +199,7 @@ enum RoomDetailsScreenViewAction {
case ignoreConfirmed
case unignoreConfirmed
case processTapNotifications
case processTapRecipientProfile
case processToggleMuteNotifications
case displayAvatar(URL)
case processTapPolls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
actionsSubject.send(.displayKnockingRequests)
case .processTapSecurityAndPrivacy:
actionsSubject.send(.displaySecurityAndPrivacy)
case .processTapRecipientProfile:
guard let userID = dmRecipient?.userID else {
return
}
actionsSubject.send(.requestRecipientDetailsPresentation(userID: userID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ struct RoomDetailsScreen: View {

var body: some View {
Form {
if let recipient = context.viewState.dmRecipient,
let accountOwner = context.viewState.accountOwner {
dmHeaderSection(accountOwner: accountOwner,
recipient: recipient)
if let recipient = context.viewState.dmRecipient {
dmHeaderSection(recipient: recipient)
} else {
normalRoomHeaderSection
}
Expand Down Expand Up @@ -79,9 +77,9 @@ struct RoomDetailsScreen: View {
.accessibilityIdentifier(A11yIdentifiers.roomDetailsScreen.avatar)
}

private func dmHeaderSection(accountOwner: RoomMemberDetails, recipient: RoomMemberDetails) -> some View {
AvatarHeaderView(accountOwner: accountOwner,
dmRecipient: recipient,
private func dmHeaderSection(recipient: RoomMemberDetails) -> some View {
AvatarHeaderView(member: recipient,
avatarSize: .room(on: .details),
mediaProvider: context.mediaProvider) { url in
context.send(viewAction: .displayAvatar(url))
} footer: {
Expand Down Expand Up @@ -204,6 +202,14 @@ struct RoomDetailsScreen: View {
context.send(viewAction: .processTapSecurityAndPrivacy)
})
}

if let dmRecipient = context.viewState.dmRecipient {
ListRow(label: .default(title: L10n.screenRoomDetailsProfileRowTitle,
icon: \.userProfile),
kind: .navigationLink {
context.send(viewAction: .processTapRecipientProfile)
})
}
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5ff8f46

Please sign in to comment.