2022-10-05 14:51:42 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import utils 1.0
|
|
|
|
import shared.views.chat 1.0
|
|
|
|
|
|
|
|
import "../controls"
|
|
|
|
import "../panels"
|
|
|
|
|
|
|
|
ActivityNotificationBase {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var messageContextMenu
|
|
|
|
|
|
|
|
signal activityCenterClose()
|
|
|
|
|
|
|
|
bodyComponent: MessageView {
|
2022-10-20 11:57:41 +00:00
|
|
|
readonly property var contactDetails: Utils.getContactDetailsAsJson(notification.author)
|
2022-10-05 14:51:42 +00:00
|
|
|
|
|
|
|
rootStore: root.store
|
|
|
|
messageStore: root.store.messageStore
|
|
|
|
messageId: notification.id
|
|
|
|
messageText: qsTr("Wants to join")
|
|
|
|
messageTimestamp: notification.timestamp
|
|
|
|
senderId: notification.author
|
|
|
|
senderIcon: contactDetails.displayIcon
|
2022-10-20 11:57:41 +00:00
|
|
|
senderDisplayName: contactDetails.displayName
|
|
|
|
senderOptionalName: contactDetails.localNickname
|
2022-10-19 12:54:45 +00:00
|
|
|
messageContextMenu: root.messageContextMenu
|
2022-10-05 14:51:42 +00:00
|
|
|
activityCenterMessage: true
|
|
|
|
activityCenterMessageRead: false
|
|
|
|
onImageClicked: Global.openImagePopup(image, root.messageContextMenu)
|
2022-10-13 15:52:44 +00:00
|
|
|
messageClickHandler: (sender,
|
|
|
|
point,
|
|
|
|
isProfileClick,
|
|
|
|
isSticker = false,
|
|
|
|
isImage = false,
|
|
|
|
image = null,
|
|
|
|
isEmoji = false,
|
|
|
|
ideEmojiPicker = false,
|
|
|
|
isReply = false,
|
|
|
|
isRightClickOnImage = false,
|
|
|
|
imageSource = "") => {
|
|
|
|
if (isProfileClick) {
|
|
|
|
return Global.openProfilePopup(notification.author)
|
|
|
|
}
|
|
|
|
|
|
|
|
root.activityCenterClose()
|
2022-10-26 16:00:20 +00:00
|
|
|
root.activityCenterStore.switchTo(notification)
|
2022-10-13 15:52:44 +00:00
|
|
|
}
|
2022-10-05 14:51:42 +00:00
|
|
|
|
|
|
|
CommunityBadge {
|
|
|
|
readonly property var community: root.store.getCommunityDetailsAsJson(notification.communityId)
|
|
|
|
|
2022-10-26 16:00:20 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.verticalCenterOffset: 15
|
2022-10-05 14:51:42 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 160 // TODO: get right text margin
|
|
|
|
communityName: community.name
|
|
|
|
communityImage: community.image
|
|
|
|
communityColor: community.color
|
|
|
|
|
2022-10-13 15:52:44 +00:00
|
|
|
onCommunityNameClicked: root.store.setActiveCommunity(notification.communityId)
|
2022-10-05 14:51:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ctaComponent: MembershipCta {
|
2022-10-13 15:52:44 +00:00
|
|
|
pending: notification.membershipStatus === Constants.activityCenterMembershipStatusPending
|
|
|
|
accepted: notification.membershipStatus === Constants.activityCenterMembershipStatusAccepted
|
|
|
|
declined: notification.membershipStatus === Constants.activityCenterMembershipStatusDeclined
|
2022-10-19 12:56:00 +00:00
|
|
|
onAcceptRequestToJoinCommunity: root.store.acceptRequestToJoinCommunity(notification.id, notification.communityId)
|
|
|
|
onDeclineRequestToJoinCommunity: root.store.declineRequestToJoinCommunity(notification.id, notification.communityId)
|
2022-10-05 14:51:42 +00:00
|
|
|
}
|
|
|
|
}
|