mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-22 19:48:52 +00:00
feat: support seeing who liked a message
This commit is contained in:
parent
2baa55b5c4
commit
9f6e582111
@ -1,4 +1,5 @@
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 2.13
|
||||
import "../../../../../shared"
|
||||
import "../../../../../imports"
|
||||
|
||||
@ -23,11 +24,13 @@ Item {
|
||||
if (!byEmoji[reaction.emojiId]) {
|
||||
byEmoji[reaction.emojiId] = {
|
||||
emojiId: reaction.emojiId,
|
||||
fromAccounts: [],
|
||||
count: 0,
|
||||
currentUserReacted: false
|
||||
}
|
||||
}
|
||||
byEmoji[reaction.emojiId].count++;
|
||||
byEmoji[reaction.emojiId].fromAccounts.push(chatsModel.userNameOrAlias(reaction.from));
|
||||
if (!byEmoji[reaction.emojiId].currentUserReacted && reaction.from === profileModel.profile.pubKey) {
|
||||
byEmoji[reaction.emojiId].currentUserReacted = true
|
||||
}
|
||||
@ -49,6 +52,11 @@ Item {
|
||||
anchors.leftMargin: (index === 0) ? 0 : root.imageMargin
|
||||
color: modelData.currentUserReacted ? Style.current.primary : Style.current.inputBackground
|
||||
|
||||
ToolTip {
|
||||
visible: mouseArea.containsMouse
|
||||
text: modelData.fromAccounts.join(", ")
|
||||
}
|
||||
|
||||
// Rounded corner to cover one corner
|
||||
Rectangle {
|
||||
color: parent.color
|
||||
@ -95,7 +103,9 @@ Item {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
chatsModel.toggleEmojiReaction(messageId, modelData.emojiId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user