2022-09-15 16:34:41 +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 utils 1.0
|
|
|
|
|
2022-09-21 13:00:35 +00:00
|
|
|
import "../controls"
|
|
|
|
|
2022-09-16 13:06:52 +00:00
|
|
|
ActivityNotificationMessage {
|
2022-09-15 16:34:41 +00:00
|
|
|
id: root
|
|
|
|
|
2022-09-23 12:24:50 +00:00
|
|
|
badgeComponent: notification.message.communityId ? communityBadgeComponent : notification.chatId ? groupChatBadgeComponent : null
|
2022-09-21 13:00:35 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: communityBadgeComponent
|
|
|
|
|
|
|
|
CommunityBadge {
|
|
|
|
id: communityBadge
|
|
|
|
|
2022-09-22 16:35:18 +00:00
|
|
|
property var community: root.store.getCommunityDetailsAsJson(notification.message.communityId)
|
|
|
|
// TODO: here i need chanel
|
|
|
|
// property var channel: root.store.chatSectionModule.getItemAsJson(notification.chatId)
|
|
|
|
|
|
|
|
communityName: community.name
|
|
|
|
communityImage: community.image
|
|
|
|
communityColor: community.color
|
2022-09-21 13:00:35 +00:00
|
|
|
|
2022-09-22 16:35:18 +00:00
|
|
|
// channelName: channel.name
|
2022-09-21 13:00:35 +00:00
|
|
|
|
2022-09-22 16:35:18 +00:00
|
|
|
onCommunityNameClicked: {
|
|
|
|
root.store.setActiveCommunity(notification.message.communityId)
|
|
|
|
}
|
|
|
|
onChannelNameClicked: {
|
|
|
|
root.activityCenterClose()
|
|
|
|
root.store.activityCenterModuleInst.switchTo(notification.sectionId, notification.chatId, notification.id)
|
|
|
|
}
|
2022-09-21 13:00:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: groupChatBadgeComponent
|
|
|
|
|
|
|
|
ChannelBadge {
|
|
|
|
realChatType: root.realChatType
|
|
|
|
textColor: Utils.colorForPubkey(notification.message.senderId)
|
|
|
|
name: root.name
|
|
|
|
profileImage: Global.getProfileImage(notification.message.chatId)
|
|
|
|
}
|
|
|
|
}
|
2022-09-15 16:34:41 +00:00
|
|
|
}
|