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 2.3
|
||||||
|
import QtQuick.Controls 2.13
|
||||||
import "../../../../../shared"
|
import "../../../../../shared"
|
||||||
import "../../../../../imports"
|
import "../../../../../imports"
|
||||||
|
|
||||||
@ -23,11 +24,13 @@ Item {
|
|||||||
if (!byEmoji[reaction.emojiId]) {
|
if (!byEmoji[reaction.emojiId]) {
|
||||||
byEmoji[reaction.emojiId] = {
|
byEmoji[reaction.emojiId] = {
|
||||||
emojiId: reaction.emojiId,
|
emojiId: reaction.emojiId,
|
||||||
|
fromAccounts: [],
|
||||||
count: 0,
|
count: 0,
|
||||||
currentUserReacted: false
|
currentUserReacted: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
byEmoji[reaction.emojiId].count++;
|
byEmoji[reaction.emojiId].count++;
|
||||||
|
byEmoji[reaction.emojiId].fromAccounts.push(chatsModel.userNameOrAlias(reaction.from));
|
||||||
if (!byEmoji[reaction.emojiId].currentUserReacted && reaction.from === profileModel.profile.pubKey) {
|
if (!byEmoji[reaction.emojiId].currentUserReacted && reaction.from === profileModel.profile.pubKey) {
|
||||||
byEmoji[reaction.emojiId].currentUserReacted = true
|
byEmoji[reaction.emojiId].currentUserReacted = true
|
||||||
}
|
}
|
||||||
@ -49,6 +52,11 @@ Item {
|
|||||||
anchors.leftMargin: (index === 0) ? 0 : root.imageMargin
|
anchors.leftMargin: (index === 0) ? 0 : root.imageMargin
|
||||||
color: modelData.currentUserReacted ? Style.current.primary : Style.current.inputBackground
|
color: modelData.currentUserReacted ? Style.current.primary : Style.current.inputBackground
|
||||||
|
|
||||||
|
ToolTip {
|
||||||
|
visible: mouseArea.containsMouse
|
||||||
|
text: modelData.fromAccounts.join(", ")
|
||||||
|
}
|
||||||
|
|
||||||
// Rounded corner to cover one corner
|
// Rounded corner to cover one corner
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: parent.color
|
color: parent.color
|
||||||
@ -95,7 +103,9 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
chatsModel.toggleEmojiReaction(messageId, modelData.emojiId)
|
chatsModel.toggleEmojiReaction(messageId, modelData.emojiId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user