mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 19:10:49 +02:00
Device Manager: Verify session (#6832)
* Initial implementation * Add verificationState to UserSessionInfo * Listen for changes device changes in the service.
This commit is contained in:
@@ -38,14 +38,12 @@ struct DeviceAvatarView: View {
|
||||
.clipShape(Circle())
|
||||
|
||||
// Verification badge
|
||||
if let isVerified = viewData.isVerified {
|
||||
Image(isVerified ? Asset.Images.userSessionVerified.name : Asset.Images.userSessionUnverified.name)
|
||||
.frame(maxWidth: CGFloat(badgeSize), maxHeight: CGFloat(badgeSize))
|
||||
.shapedBorder(color: theme.colors.system, borderWidth: 1, shape: Circle())
|
||||
.background(theme.colors.background)
|
||||
.clipShape(Circle())
|
||||
.offset(x: 10, y: 8)
|
||||
}
|
||||
Image(viewData.verificationImageName)
|
||||
.frame(maxWidth: CGFloat(badgeSize), maxHeight: CGFloat(badgeSize))
|
||||
.shapedBorder(color: theme.colors.system, borderWidth: 1, shape: Circle())
|
||||
.background(theme.colors.background)
|
||||
.clipShape(Circle())
|
||||
.offset(x: 10, y: 8)
|
||||
}
|
||||
.frame(maxWidth: CGFloat(avatarSize), maxHeight: CGFloat(avatarSize))
|
||||
}
|
||||
@@ -54,20 +52,20 @@ struct DeviceAvatarView: View {
|
||||
struct DeviceAvatarViewListPreview: View {
|
||||
var viewDataList: [DeviceAvatarViewData] {
|
||||
[
|
||||
DeviceAvatarViewData(deviceType: .desktop, isVerified: true),
|
||||
DeviceAvatarViewData(deviceType: .web, isVerified: true),
|
||||
DeviceAvatarViewData(deviceType: .mobile, isVerified: true),
|
||||
DeviceAvatarViewData(deviceType: .unknown, isVerified: true)
|
||||
DeviceAvatarViewData(deviceType: .desktop, verificationState: .verified),
|
||||
DeviceAvatarViewData(deviceType: .web, verificationState: .verified),
|
||||
DeviceAvatarViewData(deviceType: .mobile, verificationState: .verified),
|
||||
DeviceAvatarViewData(deviceType: .unknown, verificationState: .verified)
|
||||
]
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
VStack(alignment: .center, spacing: 20) {
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .web, isVerified: true))
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .desktop, isVerified: false))
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .mobile, isVerified: true))
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .unknown, isVerified: false))
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .web, verificationState: .verified))
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .desktop, verificationState: .unverified))
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .mobile, verificationState: .verified))
|
||||
DeviceAvatarView(viewData: DeviceAvatarViewData(deviceType: .unknown, verificationState: .unverified))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user