Add a UserProfileScreen for profiles of non-members. (#2687)

This commit is contained in:
Doug
2024-04-12 09:54:14 +01:00
committed by GitHub
parent 47912d999b
commit 5c9d0975ce
22 changed files with 520 additions and 56 deletions
@@ -21,19 +21,6 @@ struct RoomMemberDetailsScreen: View {
@ObservedObject var context: RoomMemberDetailsScreenViewModel.Context
var body: some View {
content
.compoundList()
.navigationTitle(L10n.screenRoomMemberDetailsTitle)
.alert(item: $context.ignoreUserAlert, actions: blockUserAlertActions, message: blockUserAlertMessage)
.alert(item: $context.alertInfo)
.track(screen: .User)
.interactiveQuickLook(item: $context.mediaPreviewItem, shouldHideControls: true)
}
// MARK: - Private
@ViewBuilder
private var content: some View {
Form {
headerSection
@@ -42,8 +29,16 @@ struct RoomMemberDetailsScreen: View {
blockUserSection
}
}
.compoundList()
.navigationTitle(L10n.screenRoomMemberDetailsTitle)
.alert(item: $context.ignoreUserAlert, actions: blockUserAlertActions, message: blockUserAlertMessage)
.alert(item: $context.alertInfo)
.track(screen: .User)
.interactiveQuickLook(item: $context.mediaPreviewItem, shouldHideControls: true)
}
// MARK: - Private
@ViewBuilder
private var headerSection: some View {
if let memberDetails = context.viewState.memberDetails {
@@ -63,7 +58,7 @@ struct RoomMemberDetailsScreen: View {
}
}
} else {
AvatarHeaderView(member: .init(loading: context.viewState.userID),
AvatarHeaderView(user: UserProfileProxy(userID: context.viewState.userID),
avatarSize: .user(on: .memberDetails),
imageProvider: context.imageProvider,
footer: { })