mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Rename UserProfileProxy to UserProfile. It's a pure struct and proxies nothing.
Also remove the redundant `userID` property given `id` already exists (for Identifiable conformance).
This commit is contained in:
+2
-2
@@ -12,7 +12,7 @@ struct InviteUsersConfirmationSheetView: View {
|
||||
@ObservedObject var context: InviteUsersScreenViewModel.Context
|
||||
|
||||
/// The users whose identities we wish the user to confirm.
|
||||
var users: [UserProfileProxy]
|
||||
var users: [UserProfile]
|
||||
|
||||
var body: some View {
|
||||
FullscreenDialog(topPadding: 24, horizontalPadding: 24) {
|
||||
@@ -22,7 +22,7 @@ struct InviteUsersConfirmationSheetView: View {
|
||||
icon: \.userAddSolid,
|
||||
iconStyle: .defaultSolid)
|
||||
VStack(spacing: 0) {
|
||||
ForEach(users, id: \.userID) { user in
|
||||
ForEach(users, id: \.id) { user in
|
||||
UserProfileListRow(user: user,
|
||||
membership: nil,
|
||||
mediaProvider: context.mediaProvider,
|
||||
|
||||
@@ -83,7 +83,7 @@ struct InviteUsersScreen: View {
|
||||
private var usersSection: some View {
|
||||
if !context.viewState.usersSection.users.isEmpty {
|
||||
Section {
|
||||
ForEach(context.viewState.usersSection.users, id: \.userID) { user in
|
||||
ForEach(context.viewState.usersSection.users, id: \.id) { user in
|
||||
UserProfileListRow(user: user,
|
||||
membership: context.viewState.membershipState(user),
|
||||
mediaProvider: context.mediaProvider,
|
||||
@@ -109,7 +109,7 @@ struct InviteUsersScreen: View {
|
||||
private var selectedUsersSection: some View {
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
HStack(spacing: 8) {
|
||||
ForEach(context.viewState.selectedUsers, id: \.userID) { user in
|
||||
ForEach(context.viewState.selectedUsers, id: \.id) { user in
|
||||
InviteUsersScreenSelectedItem(user: user,
|
||||
mediaProvider: context.mediaProvider,
|
||||
isLocked: context.viewState.isInviteeMandatory(user)) {
|
||||
@@ -150,7 +150,7 @@ struct InviteUsersScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func deselect(_ user: UserProfileProxy) {
|
||||
private func deselect(_ user: UserProfile) {
|
||||
context.send(viewAction: .toggleUser(user))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct InviteUsersScreenSelectedItem: View {
|
||||
let user: UserProfileProxy
|
||||
let user: UserProfile
|
||||
let mediaProvider: MediaProviderProtocol?
|
||||
var isLocked = false
|
||||
let dismissAction: () -> Void
|
||||
@@ -20,7 +20,7 @@ struct InviteUsersScreenSelectedItem: View {
|
||||
avatar
|
||||
.accessibilityHidden(true)
|
||||
|
||||
Text(user.displayName ?? user.userID)
|
||||
Text(user.displayName ?? user.id)
|
||||
.font(.compound.bodySM)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
.lineLimit(1)
|
||||
@@ -39,7 +39,7 @@ struct InviteUsersScreenSelectedItem: View {
|
||||
var avatar: some View {
|
||||
let avatarImage = LoadableAvatarImage(url: user.avatarURL,
|
||||
name: user.displayName,
|
||||
contentID: user.userID,
|
||||
contentID: user.id,
|
||||
avatarSize: .user(on: .inviteUsers),
|
||||
mediaProvider: mediaProvider)
|
||||
if isLocked {
|
||||
@@ -58,12 +58,12 @@ struct InviteUsersScreenSelectedItem: View {
|
||||
}
|
||||
|
||||
struct InviteUsersScreenSelectedItem_Previews: PreviewProvider, TestablePreview {
|
||||
static let people: [UserProfileProxy] = [.mockAlice, .mockVerbose]
|
||||
static let people: [UserProfile] = [.mockAlice, .mockVerbose]
|
||||
|
||||
static var previews: some View {
|
||||
ScrollView(.horizontal) {
|
||||
HStack(spacing: 8) {
|
||||
ForEach(people, id: \.userID) { user in
|
||||
ForEach(people, id: \.id) { user in
|
||||
InviteUsersScreenSelectedItem(user: user, mediaProvider: MediaProviderMock(.init())) { }
|
||||
.frame(width: 80)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user