2023-05-19 19:07:50 +03:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
2024-10-15 21:26:12 +02:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-05-19 19:07:50 +03:00
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
|
|
|
|
|
|
|
Row {
|
|
|
|
id: root
|
|
|
|
|
2024-10-01 17:10:46 +02:00
|
|
|
property var reactionsModel
|
2023-05-19 19:07:50 +03:00
|
|
|
|
|
|
|
signal toggleReaction(int emojiId)
|
|
|
|
|
2024-10-15 21:26:12 +02:00
|
|
|
spacing: Theme.halfPadding
|
|
|
|
leftPadding: Theme.halfPadding
|
|
|
|
rightPadding: Theme.halfPadding
|
2023-05-19 19:07:50 +03:00
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: root.reactionsModel
|
|
|
|
delegate: EmojiReaction {
|
2024-10-15 21:26:12 +02:00
|
|
|
source: Theme.svg(model.filename)
|
2023-05-19 19:07:50 +03:00
|
|
|
emojiId: model.emojiId
|
2023-12-18 14:34:10 -08:00
|
|
|
reactedByUser: model.didIReactWithThisEmoji
|
2023-05-19 19:07:50 +03:00
|
|
|
onCloseModal: {
|
2023-12-18 14:34:10 -08:00
|
|
|
if (reactedByUser) {
|
|
|
|
return
|
|
|
|
}
|
2023-05-19 19:07:50 +03:00
|
|
|
root.toggleReaction(emojiId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|