2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
|
2022-04-07 07:44:49 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.controls 1.0
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-09-13 14:20:10 +00:00
|
|
|
import "../controls"
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: wrapper
|
|
|
|
|
2022-04-07 07:44:49 +00:00
|
|
|
property bool isCommunity: false
|
2021-10-01 15:58:36 +00:00
|
|
|
property string name: "channelName"
|
|
|
|
property int realChatType: -1
|
|
|
|
property string channelName: ""
|
|
|
|
property string communityName: ""
|
|
|
|
property string communityColor: ""
|
|
|
|
property string communityThumbnailImage: ""
|
2022-05-10 16:04:25 +00:00
|
|
|
property int repliedMessageId
|
2021-10-01 15:58:36 +00:00
|
|
|
property string repliedMessageContent: ""
|
|
|
|
property int notificationType
|
|
|
|
property string profileImage: ""
|
|
|
|
|
2022-04-07 07:44:49 +00:00
|
|
|
property color textColor: Theme.palette.baseColor1
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
signal communityNameClicked()
|
|
|
|
signal channelNameClicked()
|
|
|
|
|
|
|
|
height: visible ? 24 : 0
|
|
|
|
width: childrenRect.width + 12
|
|
|
|
color: Style.current.transparent
|
|
|
|
border.color: Style.current.borderSecondary
|
|
|
|
border.width: 1
|
|
|
|
radius: 11
|
2022-05-10 16:04:25 +00:00
|
|
|
visible: (repliedMessageId > -1)
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
active: true
|
|
|
|
height: parent.height
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 4
|
|
|
|
sourceComponent: {
|
|
|
|
switch (wrapper.notificationType) {
|
2022-04-07 07:44:49 +00:00
|
|
|
case Constants.activityCenterNotificationTypeMention: return wrapper.isCommunity? communityBadgeComponent : channelBadgeComponent
|
2021-10-01 15:58:36 +00:00
|
|
|
case Constants.activityCenterNotificationTypeReply: return replyComponent
|
2022-04-07 07:44:49 +00:00
|
|
|
default: return wrapper.isCommunity? communityBadgeComponent : channelBadgeComponent
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-21 09:18:36 +00:00
|
|
|
Component {
|
2021-10-01 15:58:36 +00:00
|
|
|
id: replyComponent
|
2022-09-13 14:20:10 +00:00
|
|
|
|
|
|
|
ReplyComponent {
|
2021-10-21 09:18:36 +00:00
|
|
|
width: childrenRect.width
|
|
|
|
height: parent.height
|
|
|
|
repliedMessageContent: wrapper.repliedMessageContent
|
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 09:18:36 +00:00
|
|
|
Component {
|
2021-10-01 15:58:36 +00:00
|
|
|
id: communityBadgeComponent
|
2022-09-13 14:20:10 +00:00
|
|
|
|
|
|
|
CommunityBadge {
|
2021-10-21 09:18:36 +00:00
|
|
|
width: childrenRect.width
|
|
|
|
height: parent.height
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2021-10-21 09:18:36 +00:00
|
|
|
textColor: wrapper.textColor
|
|
|
|
image: wrapper.communityThumbnailImage
|
|
|
|
iconColor: wrapper.communityColor
|
|
|
|
communityName: wrapper.communityName
|
|
|
|
channelName: wrapper.channelName
|
|
|
|
name: wrapper.name
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-04-07 07:44:49 +00:00
|
|
|
onCommunityNameClicked: wrapper.communityNameClicked()
|
|
|
|
onChannelNameClicked: wrapper.channelNameClicked()
|
2021-10-21 09:18:36 +00:00
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 09:18:36 +00:00
|
|
|
Component {
|
2021-10-01 15:58:36 +00:00
|
|
|
id: channelBadgeComponent
|
2022-09-13 14:20:10 +00:00
|
|
|
|
|
|
|
ChannelBadge {
|
2021-10-21 09:18:36 +00:00
|
|
|
width: childrenRect.width
|
|
|
|
height: parent.height
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2021-10-21 09:18:36 +00:00
|
|
|
realChatType: wrapper.realChatType
|
|
|
|
textColor: wrapper.textColor
|
|
|
|
name: wrapper.name
|
|
|
|
profileImage: wrapper.profileImage
|
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
}
|