2021-05-26 17:36:24 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-05-28 17:35:21 +00:00
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../shared/status"
|
2021-05-26 17:36:24 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
property string name
|
|
|
|
property string address
|
|
|
|
property string identicon
|
|
|
|
property string localNickname
|
|
|
|
property var profileClick: function() {}
|
|
|
|
signal blockContactActionTriggered(name: string, address: string)
|
|
|
|
property bool isHovered: false
|
|
|
|
id: container
|
|
|
|
|
|
|
|
height: visible ? 64 : 0
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
border.width: 0
|
|
|
|
radius: Style.current.radius
|
|
|
|
color: isHovered ? Style.current.backgroundHover : Style.current.transparent
|
|
|
|
|
|
|
|
StatusImageIdenticon {
|
|
|
|
id: accountImage
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
source: identicon
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: usernameText
|
|
|
|
text: name
|
|
|
|
elide: Text.ElideRight
|
|
|
|
font.pixelSize: 17
|
|
|
|
anchors.top: accountImage.top
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
anchors.left: accountImage.right
|
|
|
|
anchors.leftMargin: Style.current.padding
|
2021-06-15 19:34:36 +00:00
|
|
|
anchors.right: buttons.left
|
2021-05-26 17:36:24 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
HoverHandler {
|
|
|
|
onHoveredChanged: container.isHovered = hovered
|
|
|
|
}
|
|
|
|
|
2021-06-15 19:34:36 +00:00
|
|
|
AcceptRejectOptionsButtons {
|
|
|
|
id: buttons
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2021-05-26 17:36:24 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-06-15 19:34:36 +00:00
|
|
|
onAcceptClicked: {
|
2021-06-17 22:09:00 +00:00
|
|
|
chatsModel.channelView.joinPrivateChat(container.address, "")
|
2021-05-26 20:04:42 +00:00
|
|
|
profileModel.contacts.addContact(container.address)
|
|
|
|
}
|
2021-06-15 19:34:36 +00:00
|
|
|
onDeclineClicked: profileModel.contacts.rejectContactRequest(container.address)
|
|
|
|
onProfileClicked: profileClick(true, name, address, identicon, "", localNickname)
|
|
|
|
onBlockClicked: container.blockContactActionTriggered(name, address)
|
2021-05-26 17:36:24 +00:00
|
|
|
}
|
|
|
|
}
|