moment/harmonyqml/components/Chat/Banners/InviteBanner.qml

42 lines
1017 B
QML
Raw Normal View History

import QtQuick 2.7
import "../../Base"
Banner {
property var inviter: null
color: HStyle.chat.inviteBanner.background
2019-04-29 01:01:38 +10:00
avatar.name: inviter ? inviter.displayname : ""
//avatar.imageSource: inviter ? inviter.avatar_url : ""
labelText:
(inviter ?
("<b>" + inviter.displayname + "</b>") : qsTr("Someone")) +
" " + qsTr("invited you to join the room.")
buttonModel: [
{
name: "accept",
text: qsTr("Accept"),
2019-04-27 06:02:20 +10:00
iconName: "invite_accept",
},
{
name: "decline",
text: qsTr("Decline"),
2019-04-27 06:02:20 +10:00
iconName: "invite_decline",
}
]
buttonCallbacks: {
"accept": function(button) {
button.loading = true
Backend.clients.get(chatPage.userId).joinRoom(chatPage.roomId)
},
"decline": function(button) {
button.loading = true
Backend.clients.get(chatPage.userId).leaveRoom(chatPage.roomId)
}
}
}