2021-10-01 18:58:36 +03:00
|
|
|
import QtQuick 2.3
|
2021-10-28 00:27:49 +03:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-01 18:58:36 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
2022-03-09 11:27:32 +01:00
|
|
|
import StatusQ.Components 0.1
|
2022-04-07 21:02:54 +02:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-03-09 11:27:32 +01:00
|
|
|
|
2021-10-01 18:58:36 +03:00
|
|
|
Loader {
|
|
|
|
id: root
|
2022-03-09 11:27:32 +01:00
|
|
|
|
2022-08-10 17:04:56 +03:00
|
|
|
property int imageHeight: 44
|
|
|
|
property int imageWidth: 44
|
2022-03-09 11:27:32 +01:00
|
|
|
|
|
|
|
property string name
|
|
|
|
property string pubkey
|
2022-03-30 17:30:28 +02:00
|
|
|
property string image
|
2022-12-01 11:24:25 +01:00
|
|
|
property bool showRing: !ensVerified
|
2022-03-09 11:27:32 +01:00
|
|
|
property bool interactive: true
|
2022-09-15 09:31:38 +02:00
|
|
|
property bool disabled: false
|
2022-12-01 11:24:25 +01:00
|
|
|
property bool ensVerified: false
|
2023-04-06 10:56:50 +03:00
|
|
|
property bool loading: false
|
2022-03-09 11:27:32 +01:00
|
|
|
|
2022-04-07 21:02:54 +02:00
|
|
|
property int colorId: Utils.colorIdForPubkey(pubkey)
|
2022-12-01 11:24:25 +01:00
|
|
|
property var colorHash: Utils.getColorHashAsJson(pubkey, ensVerified)
|
2022-04-07 21:02:54 +02:00
|
|
|
|
2022-03-09 11:27:32 +01:00
|
|
|
signal clicked()
|
|
|
|
|
|
|
|
sourceComponent: StatusSmartIdenticon {
|
|
|
|
name: root.name
|
2022-08-11 14:55:08 +03:00
|
|
|
asset {
|
2022-03-09 11:27:32 +01:00
|
|
|
width: root.imageWidth
|
|
|
|
height: root.imageHeight
|
2022-12-01 11:24:25 +01:00
|
|
|
color: Utils.colorForColorId(root.colorId)
|
2022-08-11 14:55:08 +03:00
|
|
|
name: root.image
|
2022-03-09 11:27:32 +01:00
|
|
|
charactersLen: 2
|
2022-08-11 14:55:08 +03:00
|
|
|
isImage: true
|
2022-03-09 11:27:32 +01:00
|
|
|
}
|
|
|
|
ringSettings {
|
2022-04-07 21:02:54 +02:00
|
|
|
ringSpecModel: root.showRing ? root.colorHash : undefined
|
2022-03-09 11:27:32 +01:00
|
|
|
}
|
2023-04-06 10:56:50 +03:00
|
|
|
loading: root.loading
|
2022-03-09 11:27:32 +01:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
active: root.interactive
|
2021-12-09 13:53:40 +01:00
|
|
|
|
2022-03-09 11:27:32 +01:00
|
|
|
sourceComponent: MouseArea {
|
2022-09-15 09:31:38 +02:00
|
|
|
cursorShape: hoverEnabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
|
|
hoverEnabled: !root.disabled
|
2022-07-21 12:57:41 +02:00
|
|
|
onClicked: {
|
2022-09-15 09:31:38 +02:00
|
|
|
if (!root.disabled) {
|
|
|
|
root.clicked()
|
|
|
|
}
|
2022-07-21 12:57:41 +02:00
|
|
|
}
|
2021-10-01 18:58:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|