mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add support for showing the user's own status over their avatar on the app's Settings button. (#5912)
* Add a common .inverseMask view modifier and use a blend mode for efficiency.
This also fixes the snapshot rendering 🎉
* Add support for the status emoji on the app's Setting button.
* Align the room header decoration icons with the status emoji.
* Add missing snapshots.
This commit is contained in:
@@ -52,39 +52,42 @@ struct RoomHeaderView: View {
|
||||
avatarImage
|
||||
.accessibilityHidden(true)
|
||||
|
||||
HStack(spacing: 4) {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack(spacing: 8) {
|
||||
Text(roomName)
|
||||
.lineLimit(1)
|
||||
.font(.compound.bodyMDSemibold)
|
||||
.foregroundStyle(.compound.textPrimary)
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.name)
|
||||
|
||||
if let statusEmoji = dmRecipientDetails.statusEmoji {
|
||||
Text(String(statusEmoji))
|
||||
.font(.compound.bodyLG)
|
||||
.foregroundStyle(.compound.textPrimary)
|
||||
}
|
||||
}
|
||||
|
||||
if let roomSubtitle {
|
||||
Text(roomSubtitle)
|
||||
.lineLimit(1)
|
||||
.font(.compound.bodyXS)
|
||||
.foregroundStyle(.compound.textSecondary)
|
||||
}
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
roomDetails
|
||||
|
||||
if let verificationState = dmRecipientDetails.verification {
|
||||
VerificationBadge(verificationState: verificationState, size: .xSmall, relativeTo: .compound.bodyMDSemibold)
|
||||
if let roomSubtitle {
|
||||
Text(roomSubtitle)
|
||||
.lineLimit(1)
|
||||
.font(.compound.bodyXS)
|
||||
.foregroundStyle(.compound.textSecondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var roomDetails: some View {
|
||||
HStack(spacing: 4) {
|
||||
HStack(spacing: 8) {
|
||||
Text(roomName)
|
||||
.lineLimit(1)
|
||||
.font(.compound.bodyMDSemibold)
|
||||
.foregroundStyle(.compound.textPrimary)
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.name)
|
||||
|
||||
if let historySharingIcon {
|
||||
CompoundIcon(historySharingIcon, size: .xSmall, relativeTo: .compound.bodyMDSemibold)
|
||||
.foregroundStyle(.compound.iconInfoPrimary)
|
||||
if let statusEmoji = dmRecipientDetails.statusEmoji {
|
||||
Text(String(statusEmoji))
|
||||
.font(.compound.bodyLG)
|
||||
.foregroundStyle(.compound.textPrimary)
|
||||
}
|
||||
}
|
||||
if let verificationState = dmRecipientDetails.verification {
|
||||
VerificationBadge(verificationState: verificationState, size: .xSmall, relativeTo: .compound.bodyMDSemibold)
|
||||
}
|
||||
|
||||
if let historySharingIcon {
|
||||
CompoundIcon(historySharingIcon, size: .xSmall, relativeTo: .compound.bodyMDSemibold)
|
||||
.foregroundStyle(.compound.iconInfoPrimary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user