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:
+7
-7
@@ -30,18 +30,18 @@ struct SessionVerificationRequestDetailsView: View {
|
||||
HStack(spacing: 12) {
|
||||
LoadableAvatarImage(url: details.senderProfile.avatarURL,
|
||||
name: details.senderProfile.displayName,
|
||||
contentID: details.senderProfile.userID,
|
||||
contentID: details.senderProfile.id,
|
||||
avatarSize: .user(on: .sessionVerification),
|
||||
mediaProvider: mediaProvider)
|
||||
.accessibilityHidden(true)
|
||||
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
Text(details.senderProfile.displayName ?? details.senderProfile.userID)
|
||||
Text(details.senderProfile.displayName ?? details.senderProfile.id)
|
||||
.font(.compound.bodySM)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
|
||||
if details.senderProfile.displayName != nil {
|
||||
Text(details.senderProfile.userID)
|
||||
Text(details.senderProfile.id)
|
||||
.font(.compound.bodyMD)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
}
|
||||
@@ -66,7 +66,7 @@ struct SessionVerificationRequestDetailsView: View {
|
||||
.clipShape(RoundedRectangle(cornerRadius: 8))
|
||||
|
||||
let displayName = isUserVerification ? details.senderProfile.displayName : details.deviceDisplayName
|
||||
Text(displayName ?? details.senderProfile.userID)
|
||||
Text(displayName ?? details.senderProfile.id)
|
||||
.font(.compound.bodyMDSemibold)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
@@ -110,9 +110,9 @@ struct SessionVerificationRequestDetailsView: View {
|
||||
}
|
||||
|
||||
struct SessionVerificationRequestDetailsView_Previews: PreviewProvider, TestablePreview {
|
||||
static let details = SessionVerificationRequestDetails(senderProfile: UserProfileProxy(userID: "@bob:matrix.org",
|
||||
displayName: "Billy bob",
|
||||
avatarURL: .mockMXCUserAvatar),
|
||||
static let details = SessionVerificationRequestDetails(senderProfile: UserProfile(userID: "@bob:matrix.org",
|
||||
displayName: "Billy bob",
|
||||
avatarURL: .mockMXCUserAvatar),
|
||||
flowID: "123",
|
||||
deviceID: "CODEMISTAKE",
|
||||
deviceDisplayName: "Bob's Element X iOS",
|
||||
|
||||
+3
-3
@@ -232,9 +232,9 @@ struct SessionVerification_Previews: PreviewProvider, TestablePreview {
|
||||
sessionVerificationScreen(state: .initial, flow: .userInitiator(userID: "@bob:matrix.org"))
|
||||
.previewDisplayName("Initial - User Initiator")
|
||||
|
||||
let details = SessionVerificationRequestDetails(senderProfile: UserProfileProxy(userID: "@bob:matrix.org",
|
||||
displayName: "Billy Bob",
|
||||
avatarURL: .mockMXCUserAvatar),
|
||||
let details = SessionVerificationRequestDetails(senderProfile: UserProfile(userID: "@bob:matrix.org",
|
||||
displayName: "Billy Bob",
|
||||
avatarURL: .mockMXCUserAvatar),
|
||||
flowID: "123",
|
||||
deviceID: "CODEMISTAKE",
|
||||
deviceDisplayName: "Bob's Element X iOS",
|
||||
|
||||
Reference in New Issue
Block a user