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 = proc repliedMessageItem*(self: Item): MessageItem =
return self.repliedMessageItem 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 = proc isNotReadOrActiveCTA*(self: Item): bool =
return ((self.notificationType == ActivityCenterNotificationType.CommunityMembershipRequest and return ((self.notificationType == ActivityCenterNotificationType.CommunityMembershipRequest and
self.membershipStatus == ActivityCenterMembershipStatus.Pending) or self.membershipStatus == ActivityCenterMembershipStatus.Pending) or
(self.notificationType == ActivityCenterNotificationType.ContactRequest and (self.notificationType == ActivityCenterNotificationType.ContactRequest and
self.messageItem.contactRequestState == CONTACT_REQUEST_PENDING_STATE) or self.messageItem.contactRequestState == CONTACT_REQUEST_PENDING_STATE) or
(self.notificationType == ActivityCenterNotificationType.ContactVerification and (self.notificationType == ActivityCenterNotificationType.ContactVerification and
(self.verificationStatus == VerificationStatus.Verifying or self.verificationStatus == VerificationStatus.Verifying) or
self.verificationStatus == VerificationStatus.Verified)) or
(self.notificationType == ActivityCenterNotificationType.Mention and (self.notificationType == ActivityCenterNotificationType.Mention and
not self.read) or not self.read) or
(self.notificationType == ActivityCenterNotificationType.Reply and (self.notificationType == ActivityCenterNotificationType.Reply and

View File

@ -27,7 +27,7 @@ ActivityNotificationMessage {
messageDetails.sender.profileImage.assetSettings.isImage: true messageDetails.sender.profileImage.assetSettings.isImage: true
messageDetails.sender.profileImage.pubkey: notification ? notification.author : "" messageDetails.sender.profileImage.pubkey: notification ? notification.author : ""
messageDetails.sender.profileImage.colorId: Utils.colorIdForPubkey(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 { messageBadgeComponent: CommunityBadge {
readonly property var community: notification ? readonly property var community: notification ?

View File

@ -34,7 +34,7 @@ ActivityNotificationBase {
assetSettings.isImage: contactDetails && contactDetails.displayIcon.startsWith("data") assetSettings.isImage: contactDetails && contactDetails.displayIcon.startsWith("data")
pubkey: contactId pubkey: contactId
colorId: Utils.colorIdForPubkey(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 elide: Text.ElideRight
font.pixelSize: 15 font.pixelSize: 15
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true Layout.fillWidth: !root.messageBadgeComponent
} }
Loader { Loader {
@ -93,6 +93,10 @@ RowLayout {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.fillHeight: true Layout.fillHeight: true
} }
Item {
Layout.fillWidth: !!root.messageBadgeComponent
}
} }
} }
} }