hotfix(ActivityCenter): Fix warnings and text align with messageBadge

This commit is contained in:
MishkaRogachev 2023-01-18 16:02:46 +04:00 committed by Mikhail Rogachev
parent 9e1f596b6a
commit 2890fe5845
4 changed files with 9 additions and 6 deletions

View File

@ -130,15 +130,14 @@ proc messageItem*(self: Item): MessageItem =
proc repliedMessageItem*(self: Item): MessageItem =
return self.repliedMessageItem
# TODO: this logic should be moved to status-go
# TODO: this logic should be moved to status-go (https://github.com/status-im/status-desktop/issues/8074)
proc isNotReadOrActiveCTA*(self: Item): bool =
return ((self.notificationType == ActivityCenterNotificationType.CommunityMembershipRequest and
self.membershipStatus == ActivityCenterMembershipStatus.Pending) or
(self.notificationType == ActivityCenterNotificationType.ContactRequest and
self.messageItem.contactRequestState == CONTACT_REQUEST_PENDING_STATE) or
(self.notificationType == ActivityCenterNotificationType.ContactVerification and
(self.verificationStatus == VerificationStatus.Verifying or
self.verificationStatus == VerificationStatus.Verified)) or
self.verificationStatus == VerificationStatus.Verifying) or
(self.notificationType == ActivityCenterNotificationType.Mention and
not self.read) or
(self.notificationType == ActivityCenterNotificationType.Reply and

View File

@ -27,7 +27,7 @@ ActivityNotificationMessage {
messageDetails.sender.profileImage.assetSettings.isImage: true
messageDetails.sender.profileImage.pubkey: notification ? notification.author : ""
messageDetails.sender.profileImage.colorId: Utils.colorIdForPubkey(notification ? notification.author : "")
messageDetails.sender.profileImage.colorHash: Utils.getColorHashAsJson(notification ? notification.author : "", contactDetails.ensVerified)
messageDetails.sender.profileImage.colorHash: Utils.getColorHashAsJson(notification ? notification.author : "", contactDetails && contactDetails.ensVerified)
messageBadgeComponent: CommunityBadge {
readonly property var community: notification ?

View File

@ -34,7 +34,7 @@ ActivityNotificationBase {
assetSettings.isImage: contactDetails && contactDetails.displayIcon.startsWith("data")
pubkey: contactId
colorId: Utils.colorIdForPubkey(contactId)
colorHash: Utils.getColorHashAsJson(contactId, contactDetails.ensVerified)
colorHash: Utils.getColorHashAsJson(contactId, contactDetails && contactDetails.ensVerified)
}
}

View File

@ -85,7 +85,7 @@ RowLayout {
elide: Text.ElideRight
font.pixelSize: 15
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
Layout.fillWidth: !root.messageBadgeComponent
}
Loader {
@ -93,6 +93,10 @@ RowLayout {
Layout.alignment: Qt.AlignVCenter
Layout.fillHeight: true
}
Item {
Layout.fillWidth: !!root.messageBadgeComponent
}
}
}
}