2022-10-20 15:12:38 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
2022-10-24 10:58:00 +00:00
|
|
|
import QtQuick.Layouts 1.14
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.views 1.0
|
2023-10-23 11:36:33 +00:00
|
|
|
import shared.stores 1.0
|
2023-02-07 14:21:32 +00:00
|
|
|
import mainui 1.0
|
|
|
|
|
|
|
|
import StatusQ 0.1
|
2024-02-07 14:56:45 +00:00
|
|
|
|
|
|
|
import AppLayouts.Wallet.stores 1.0
|
2023-02-28 15:00:10 +00:00
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
property bool globalUtilsReady: false
|
|
|
|
property bool mainModuleReady: false
|
|
|
|
|
|
|
|
// globalUtilsInst mock
|
2022-10-20 15:12:38 +00:00
|
|
|
QtObject {
|
2022-10-24 10:58:00 +00:00
|
|
|
function getEmojiHashAsJson(publicKey) {
|
|
|
|
return JSON.stringify(["👨🏻🍼", "🏃🏿♂️", "🌇", "🤶🏿", "🏮","🤷🏻♂️", "🤦🏻", "📣", "🤎", "👷🏽", "😺", "🥞", "🔃", "🧝🏽♂️"])
|
|
|
|
}
|
|
|
|
function getColorId(publicKey) { return colorId.value }
|
|
|
|
|
|
|
|
function getCompressedPk(publicKey) { return "zx3sh" + publicKey }
|
|
|
|
|
2022-11-08 11:37:25 +00:00
|
|
|
function getColorHashAsJson(publicKey) {
|
|
|
|
return JSON.stringify([{colorId: 0, segmentLength: 1},
|
|
|
|
{colorId: 19, segmentLength: 2}])
|
|
|
|
}
|
|
|
|
|
|
|
|
function isCompressedPubKey(publicKey) { return true }
|
2022-10-24 10:58:00 +00:00
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
function addTimestampToURL(url) {
|
|
|
|
return url
|
|
|
|
}
|
|
|
|
|
2022-10-20 15:12:38 +00:00
|
|
|
Component.onCompleted: {
|
2022-10-24 10:58:00 +00:00
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
root.globalUtilsReady = true
|
|
|
|
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
root.globalUtilsReady = false
|
|
|
|
Utils.globalUtilsInst = {}
|
2022-10-20 15:12:38 +00:00
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
// mainModuleInst mock
|
|
|
|
QtObject {
|
2024-02-07 14:56:45 +00:00
|
|
|
function getContactDetailsAsJson(publicKey, getVerificationRequest=false) {
|
|
|
|
return JSON.stringify({ displayName: displayName.text,
|
|
|
|
optionalName: "",
|
2022-10-24 10:58:00 +00:00
|
|
|
displayIcon: "",
|
|
|
|
publicKey: publicKey,
|
|
|
|
name: name.text,
|
|
|
|
ensVerified: ensVerified.checked,
|
|
|
|
alias: "Mock Alias Triplet",
|
|
|
|
lastUpdated: Date.now(),
|
|
|
|
lastUpdatedLocally: Date.now(),
|
2023-02-28 15:00:10 +00:00
|
|
|
localNickname: localNickname.text,
|
2022-10-24 10:58:00 +00:00
|
|
|
thumbnailImage: "",
|
|
|
|
largeImage: userImage.checked ? Style.png("status-logo") : "",
|
|
|
|
isContact: isContact.checked,
|
|
|
|
isBlocked: isBlocked.checked,
|
|
|
|
isSyncing: false,
|
|
|
|
trustStatus: trustStatus.currentValue,
|
|
|
|
verificationStatus: Constants.verificationStatus.unverified,
|
|
|
|
incomingVerificationStatus: Constants.verificationStatus.unverified,
|
2024-02-07 14:56:45 +00:00
|
|
|
contactRequestState: ctrlContactRequestState.currentValue,
|
2022-10-24 10:58:00 +00:00
|
|
|
bio: bio.text,
|
2022-12-05 14:21:20 +00:00
|
|
|
socialLinks: JSON.stringify
|
|
|
|
([{
|
|
|
|
text: "__twitter",
|
|
|
|
url: "https://twitter.com/ethstatus",
|
|
|
|
icon: "twitter"
|
2023-02-28 15:00:10 +00:00
|
|
|
},
|
|
|
|
{
|
2022-12-05 14:21:20 +00:00
|
|
|
text: "__github",
|
|
|
|
url: "https://github.com/status-im",
|
|
|
|
icon: "github"
|
|
|
|
}])
|
2022-10-24 10:58:00 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.mainModuleInst = this
|
2022-11-08 08:36:08 +00:00
|
|
|
root.mainModuleReady = true
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
Component.onDestruction: {
|
2022-10-24 10:58:00 +00:00
|
|
|
root.mainModuleReady = false
|
|
|
|
Utils.mainModuleInst = {}
|
2022-10-20 15:12:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
Popups {
|
|
|
|
popupParent: root
|
2023-07-25 13:35:47 +00:00
|
|
|
rootStore: QtObject {
|
|
|
|
property var contactStore: QtObject {
|
|
|
|
function changeContactNickname(publicKey, newNickname) {
|
|
|
|
logs.logEvent("rootStore::contactStore::changeContactNickname", ["publicKey", "newNickname"], arguments)
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
|
|
|
function blockContact(publicKey) {
|
|
|
|
logs.logEvent("rootStore::contactsStore::blockContact", ["publicKey"], arguments)
|
|
|
|
}
|
|
|
|
|
|
|
|
function unblockContact(publicKey) {
|
|
|
|
logs.logEvent("rootStore::contactsStore::unblockContact", ["publicKey"], arguments)
|
|
|
|
}
|
2023-07-25 13:35:47 +00:00
|
|
|
}
|
|
|
|
}
|
2023-10-23 11:36:33 +00:00
|
|
|
communityTokensStore: CommunityTokensStore {}
|
2023-02-07 14:21:32 +00:00
|
|
|
}
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
WalletAssetsStore {
|
|
|
|
id: assetsStore
|
|
|
|
assetsWithFilteredBalances: groupedAccountsAssetsModel
|
|
|
|
}
|
|
|
|
|
2022-10-20 15:12:38 +00:00
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
Item {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
clip: true
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
Loader {
|
|
|
|
active: root.globalUtilsReady && root.mainModuleReady
|
|
|
|
width: parent.availableWidth
|
|
|
|
height: parent.availableHeight
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
sourceComponent: ProfileDialogView {
|
|
|
|
implicitWidth: 640
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
readOnly: ctrlReadOnly.checked
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
publicKey: switchOwnProfile.checked ? "0xdeadbeef" : "0xrandomguy"
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2023-02-28 15:00:10 +00:00
|
|
|
onCloseRequested: logs.logEvent("closeRequested()")
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
profileStore: QtObject {
|
|
|
|
readonly property string pubkey: "0xdeadbeef"
|
|
|
|
readonly property string ensName: name.text
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
function getQrCodeSource() {
|
2024-02-07 14:56:45 +00:00
|
|
|
return "https://upload.wikimedia.org/wikipedia/commons/4/41/QR_Code_Example.svg"
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
|
|
|
function copyToClipboard(text) {
|
|
|
|
logs.logEvent("profileStore::copyToClipboard", ["text"], arguments)
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
function requestProfileShowcase(publicKey) {
|
|
|
|
console.warn("STUB: requestProfileShowcase(publicKey)")
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property var profileShowcaseCommunitiesModel: CommunitiesModel {}
|
|
|
|
readonly property var profileShowcaseAccountsModel: WalletAccountsModel {}
|
|
|
|
readonly property var profileShowcaseCollectiblesModel: ManageCollectiblesModel {}
|
|
|
|
readonly property var profileShowcaseAssetsModel: assetsStore.groupedAccountAssetsModel
|
2022-10-20 15:12:38 +00:00
|
|
|
}
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
contactsStore: QtObject {
|
|
|
|
readonly property string myPublicKey: "0xdeadbeef"
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
function joinPrivateChat(publicKey) {
|
|
|
|
logs.logEvent("contactsStore::joinPrivateChat", ["publicKey"], arguments)
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
function markUntrustworthy(publicKey) {
|
|
|
|
logs.logEvent("contactsStore::markUntrustworthy", ["publicKey"], arguments)
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
function removeContact(publicKey) {
|
|
|
|
logs.logEvent("contactsStore::removeContact", ["publicKey"], arguments)
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2023-04-03 16:27:56 +00:00
|
|
|
function acceptContactRequest(publicKey, contactRequestId) {
|
|
|
|
logs.logEvent("contactsStore::acceptContactRequest", ["publicKey, contactRequestId"], arguments)
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2023-04-03 16:27:56 +00:00
|
|
|
function dismissContactRequest(publicKey, contactRequestId) {
|
|
|
|
logs.logEvent("contactsStore::dismissContactRequest", ["publicKey, contactRequestId"], arguments)
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
function removeTrustStatus(publicKey) {
|
|
|
|
logs.logEvent("contactsStore::removeTrustStatus", ["publicKey"], arguments)
|
|
|
|
}
|
|
|
|
|
|
|
|
function verifiedUntrustworthy(publicKey) {
|
|
|
|
logs.logEvent("contactsStore::verifiedUntrustworthy", ["publicKey"], arguments)
|
|
|
|
}
|
2023-07-25 13:35:47 +00:00
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
function verifiedTrusted(publicKey) {
|
|
|
|
logs.logEvent("contactsStore::verifiedTrusted", ["publicKey"], arguments)
|
2023-07-25 13:35:47 +00:00
|
|
|
}
|
2023-02-28 15:00:10 +00:00
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
function getLinkToProfile(publicKey) {
|
|
|
|
return Constants.userLinkPrefix + publicKey
|
2023-02-28 15:00:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
walletStore: QtObject {
|
2023-04-27 13:22:27 +00:00
|
|
|
function setFilterAddress(address) {
|
|
|
|
logs.logEvent("walletStore::setFilterAddress", ["address"], arguments)
|
2023-02-28 15:00:10 +00:00
|
|
|
}
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
function getSavedAddress(address) {
|
|
|
|
return {
|
|
|
|
name: "My Status Saved Account",
|
|
|
|
address: "0xcdc2ea3b6ba8fed3a3402f8db8b2fab53e7b7000",
|
|
|
|
ens: false,
|
|
|
|
colorId: Constants.walletAccountColors.primary,
|
|
|
|
chainShortNames: "",
|
|
|
|
isTest: false
|
2023-02-28 15:00:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
function createOrUpdateSavedAddress(name, address, ens, colorId, chainShortNames) {
|
|
|
|
logs.logEvent("walletStore::createOrUpdateSavedAddress", ["name", "address", "ens", "colorId", "chainShortNames"],
|
|
|
|
arguments)
|
2023-02-28 15:00:10 +00:00
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
2023-02-28 15:00:10 +00:00
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
networkConnectionStore: QtObject {
|
|
|
|
readonly property bool sendBuyBridgeEnabled: true
|
2023-02-28 15:00:10 +00:00
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
SplitView.minimumHeight: 100
|
2022-10-24 10:58:00 +00:00
|
|
|
SplitView.preferredHeight: 350
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
ColumnLayout {
|
|
|
|
width: parent.width
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Switch {
|
|
|
|
id: switchOwnProfile
|
|
|
|
text: "Own profile"
|
|
|
|
checked: false
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
Switch {
|
|
|
|
id: ctrlReadOnly
|
|
|
|
text: "Readonly (preview)"
|
|
|
|
visible: switchOwnProfile.checked
|
|
|
|
checked: false
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2023-02-28 15:00:10 +00:00
|
|
|
Label { text: "localNickname:" }
|
|
|
|
TextField {
|
|
|
|
id: localNickname
|
|
|
|
text: "MockNickname"
|
|
|
|
placeholderText: "Local Nickname"
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
Label { text: "displayName:" }
|
|
|
|
TextField {
|
|
|
|
id: displayName
|
|
|
|
placeholderText: "Display Name"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
CheckBox {
|
|
|
|
id: userImage
|
|
|
|
text: "User image"
|
|
|
|
checked: true
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
font.italic: true
|
|
|
|
text: "or"
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
enabled: !userImage.checked
|
|
|
|
text: "colorId"
|
|
|
|
}
|
|
|
|
SpinBox {
|
|
|
|
id: colorId
|
|
|
|
enabled: !userImage.checked
|
|
|
|
from: 0
|
|
|
|
to: 11 // Theme.palette.userCustomizationColors.length
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
CheckBox {
|
|
|
|
id: ensVerified
|
|
|
|
checked: true
|
|
|
|
text: "ensVerified"
|
|
|
|
}
|
|
|
|
|
|
|
|
Label { text: "name:" }
|
|
|
|
TextField {
|
|
|
|
id: name
|
|
|
|
enabled: ensVerified.checked
|
2023-02-28 15:00:10 +00:00
|
|
|
text: ensVerified.checked ? "mock-ens-name.eth" : ""
|
2022-10-24 10:58:00 +00:00
|
|
|
placeholderText: "ENS name"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
enabled: !switchOwnProfile.checked
|
|
|
|
CheckBox {
|
|
|
|
id: isContact
|
2024-02-07 14:56:45 +00:00
|
|
|
enabled: true
|
|
|
|
checked: ctrlContactRequestState.currentValue === Constants.ContactRequestState.Mutual
|
2022-10-24 10:58:00 +00:00
|
|
|
text: "isContact"
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
ComboBox {
|
|
|
|
id: ctrlContactRequestState
|
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: [
|
|
|
|
{ value: Constants.ContactRequestState.None, text: "None" },
|
|
|
|
{ value: Constants.ContactRequestState.Mutual, text: "Mutual" },
|
|
|
|
{ value: Constants.ContactRequestState.Sent, text: "Sent" },
|
|
|
|
{ value: Constants.ContactRequestState.Received, text: "Received" },
|
|
|
|
{ value: Constants.ContactRequestState.Dismissed, text: "Dismissed" }
|
|
|
|
]
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
|
|
|
CheckBox {
|
|
|
|
id: isBlocked
|
|
|
|
text: "isBlocked"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
enabled: !switchOwnProfile.checked
|
|
|
|
Label { text: "trustStatus:" }
|
|
|
|
ComboBox {
|
|
|
|
id: trustStatus
|
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: [
|
|
|
|
{ value: Constants.trustStatus.unknown, text: "unknown" },
|
|
|
|
{ value: Constants.trustStatus.trusted, text: "trusted" },
|
|
|
|
{ value: Constants.trustStatus.untrustworthy, text: "untrustworthy" }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Label { text: "Bio:" }
|
|
|
|
TextField {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
id: bio
|
2023-02-28 15:00:10 +00:00
|
|
|
selectByMouse: true
|
2023-02-07 14:21:32 +00:00
|
|
|
text: "Hi, I am Alex. I'm an indie developer who mainly works on web products.
|
|
|
|
|
|
|
|
I worked for several different companies and created a couple of my own products from scratch. Currently building Telescope and Prepacked.
|
|
|
|
|
|
|
|
Say hi, or find me on Twitter, GitHub, or Mastodon."
|
2022-10-24 10:58:00 +00:00
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Views
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=733%3A12552
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A15078
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A17655
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A17087
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23525
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23932
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23932&t=h8DUW6Eysawqe5u0-0
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=724%3A15511&t=h8DUW6Eysawqe5u0-0
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=6%3A16845&t=h8DUW6Eysawqe5u0-0
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A25437&t=h8DUW6Eysawqe5u0-0
|