2020-07-21 21:03:22 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
|
|
|
|
|
|
|
Item {
|
|
|
|
property string username: "Jotaro Kujo"
|
|
|
|
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAhklEQVR4nOzWwQ1AQBgFYUQvelKHMtShJ9VwFyvrsExe5jvKXiYv+WPoQhhCYwiNITSG0MSEjLUPt3097r7P09L/8f4qZhFDaAyhqboIT76+TiUxixhCYwhN9b/WW6Xr1ErMIobQGEJjCI0hNIbQGEJjCI0haiRmEUNoDKExhMYQmjMAAP//B2kXcP2uDV8AAAAASUVORK5CYII="
|
|
|
|
property string pubkey: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
|
2020-08-06 18:19:26 +00:00
|
|
|
property string ensName: "joestar.eth"
|
2020-07-21 21:03:22 +00:00
|
|
|
|
|
|
|
id: profileHeaderContent
|
|
|
|
height: parent.height
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: profileImgNameContainer
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 64
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: contentMargin
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: contentMargin
|
|
|
|
|
|
|
|
height: this.childrenRect.height
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: profileImg
|
|
|
|
width: identiconImage.width
|
|
|
|
height: identiconImage.height
|
|
|
|
border.width: 1
|
|
|
|
border.color: Style.current.border
|
|
|
|
radius: 50
|
2020-07-22 20:16:06 +00:00
|
|
|
color: Style.current.background
|
2020-07-21 21:03:22 +00:00
|
|
|
|
|
|
|
Image {
|
|
|
|
id: identiconImage
|
2020-12-04 18:19:52 +00:00
|
|
|
width: 60
|
|
|
|
height: 60
|
2020-07-21 21:03:22 +00:00
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
source: identicon
|
|
|
|
mipmap: true
|
|
|
|
smooth: false
|
|
|
|
antialiasing: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: profileName
|
2020-08-06 18:19:26 +00:00
|
|
|
text: ensName !== "" ? ensName : username
|
2020-07-21 21:03:22 +00:00
|
|
|
anchors.left: profileImg.right
|
|
|
|
anchors.leftMargin: 8
|
|
|
|
anchors.top: profileImg.top
|
2020-12-04 18:19:52 +00:00
|
|
|
anchors.topMargin: 4
|
|
|
|
font.family: "Inter"
|
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pixelSize: 20
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-27 18:02:28 +00:00
|
|
|
Address {
|
2020-07-21 21:03:22 +00:00
|
|
|
id: pubkeyText
|
2020-08-06 18:19:26 +00:00
|
|
|
text: ensName !== "" ? username : pubkey
|
2020-07-21 21:03:22 +00:00
|
|
|
anchors.bottom: profileImg.bottom
|
|
|
|
anchors.left: profileName.left
|
2020-12-04 18:19:52 +00:00
|
|
|
anchors.bottomMargin: 4
|
2020-08-06 18:19:26 +00:00
|
|
|
width: 200
|
2020-07-21 21:03:22 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
2020-12-04 18:19:52 +00:00
|
|
|
Rectangle {
|
|
|
|
id: qrCodeButton
|
2020-10-06 04:16:36 +00:00
|
|
|
property bool hovered: false
|
2020-12-04 18:19:52 +00:00
|
|
|
color: hovered ? Style.current.backgroundHover : Style.current.transparent
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: 32
|
|
|
|
width: 32
|
|
|
|
radius: 8
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: qrCodeImage
|
|
|
|
source: "../../../img/qr-code-icon.svg"
|
|
|
|
width: 18
|
|
|
|
height: 18
|
|
|
|
property bool hovered: false
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2020-08-19 21:01:22 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
onExited: {
|
2020-12-04 18:19:52 +00:00
|
|
|
qrCodeButton.hovered = false
|
2020-08-19 21:01:22 +00:00
|
|
|
}
|
|
|
|
onEntered: {
|
2020-12-04 18:19:52 +00:00
|
|
|
qrCodeButton.hovered = true
|
2020-08-19 21:01:22 +00:00
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
onClicked: {
|
2020-12-04 18:19:52 +00:00
|
|
|
qrCodePopup.open()
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-19 21:01:22 +00:00
|
|
|
|
2020-12-04 18:19:52 +00:00
|
|
|
ColorOverlay {
|
|
|
|
id: qrCodeOverlay
|
|
|
|
anchors.fill: qrCodeImage
|
|
|
|
source: qrCodeImage
|
|
|
|
color: qrCodeButton.hovered ? Style.current.buttonForegroundColor : Style.current.textColor
|
|
|
|
}
|
2020-07-22 20:16:06 +00:00
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: lineSeparator
|
|
|
|
anchors.top: profileImg.bottom
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-04 18:19:52 +00:00
|
|
|
ModalPopup {
|
|
|
|
id: qrCodePopup
|
|
|
|
width: 420
|
|
|
|
height: 420
|
2020-08-19 21:01:22 +00:00
|
|
|
Image {
|
|
|
|
asynchronous: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
source: profileModel.qrCode(pubkey)
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-12-04 18:19:52 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter + 20
|
|
|
|
height: 312
|
|
|
|
width: 312
|
2020-08-19 21:01:22 +00:00
|
|
|
mipmap: true
|
|
|
|
smooth: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
Column {
|
|
|
|
anchors.right: profileImgNameContainer.right
|
|
|
|
anchors.left: profileImgNameContainer.left
|
|
|
|
spacing: Style.current.bigPadding
|
|
|
|
anchors.top: profileImgNameContainer.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
|
|
|
|
TextWithLabel {
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Chat key"
|
|
|
|
label: qsTrId("chat-key")
|
2020-07-21 21:03:22 +00:00
|
|
|
text: pubkey.substring(0, 13) + "..." + pubkey.substring(pubkey.length - 13)
|
|
|
|
textToCopy: pubkey
|
|
|
|
}
|
|
|
|
|
|
|
|
TextWithLabel {
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Share Profile URL"
|
|
|
|
label: qsTrId("share-profile-url")
|
2020-07-21 21:03:22 +00:00
|
|
|
text: `https://join.status.im/u/${pubkey.substring(0, 5)}...${pubkey.substring(pubkey.length - 5)}`
|
|
|
|
textToCopy: `https://join.status.im/u/${pubkey}`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff"}
|
|
|
|
}
|
|
|
|
##^##*/
|