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:
@@ -16,7 +16,7 @@ struct LocationShareSheet: View {
|
||||
}
|
||||
|
||||
private var senderName: String? {
|
||||
annotation.kind.displayName ?? annotation.kind.userProfile?.userID
|
||||
annotation.kind.displayName ?? annotation.kind.userProfile?.id
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@@ -40,8 +40,8 @@ struct LocationShareSheet: View {
|
||||
// MARK: - Previews
|
||||
|
||||
struct LocationShareSheet_Previews: PreviewProvider {
|
||||
static let profile = UserProfileProxy(userID: "@alice:example.com", displayName: "Alice")
|
||||
static let annotation = LocationAnnotation(id: profile.userID,
|
||||
static let profile = UserProfile(userID: "@alice:example.com", displayName: "Alice")
|
||||
static let annotation = LocationAnnotation(id: profile.id,
|
||||
coordinate: .init(latitude: 51.509865, longitude: -0.118092),
|
||||
kind: .liveUser(profile))
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ struct StaticLocationSheet: View {
|
||||
longitude: location.geoURI.longitude)))
|
||||
} label: {
|
||||
UserLocationCell(profile: profile,
|
||||
isOwnUser: context.viewState.isOwnUser(profile.userID),
|
||||
isOwnUser: context.viewState.isOwnUser(profile.id),
|
||||
kind: .static(isUserLocation: location.kind == .sender,
|
||||
timestamp: location.timestamp),
|
||||
mediaProvider: context.mediaProvider,
|
||||
|
||||
@@ -9,7 +9,7 @@ import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct UserLocationCell: View {
|
||||
let profile: UserProfileProxy
|
||||
let profile: UserProfile
|
||||
let isOwnUser: Bool
|
||||
let kind: Kind
|
||||
var mediaProvider: MediaProviderProtocol?
|
||||
@@ -23,7 +23,7 @@ struct UserLocationCell: View {
|
||||
}
|
||||
|
||||
private var name: String {
|
||||
isOwnUser ? L10n.commonYou : profile.displayName ?? profile.userID
|
||||
isOwnUser ? L10n.commonYou : profile.displayName ?? profile.id
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
||||
Reference in New Issue
Block a user